noyajr Posted August 6, 2023 Posted August 6, 2023 Hello everyone, i have a little problem here, i have some splines having profile in Z direction in autocad. i want to put points each 1m (or any distance defined by user) on those splines. When i do that with "Measure" it put point each 1m on the curvature of the curve, so in plan when i measure the distance between these points it will be less than 1m, i want the 1m to be horizontal or vertical (in plan not on the curve) i thought the solution of this is that in plan i will create points each 1m or any distance (with array for example), these points in Z direction will not be on the curve (as these points are created in plan), i want a lisp to move these points (in Z direction only) so the points will be on the splines (this process is for multiple objects) Does anyone have a lisp for that ? Thanks in advance Sample.dwg Quote
Steven P Posted August 6, 2023 Posted August 6, 2023 Have you looked for chainage LISPs, not sure if they work with splines though, I tend to use polylines instead Quote
noyajr Posted August 7, 2023 Author Posted August 7, 2023 22 hours ago, Steven P said: Have you looked for chainage LISPs, not sure if they work with splines though, I tend to use polylines instead Thanks for your reply, I tried some of them but nothing made what i want, all of the lisps put lines or points with interval 1m on the curved path not 1m in plan distance Quote
devitg Posted August 7, 2023 Posted August 7, 2023 7 hours ago, noyajr said: Thanks for your reply, I tried some of them but nothing made what i want, all of the lisps put lines or points with interval 1m on the curved path not 1m in plan distance @noyajr some like it . it s spaced in 25 equal parts , one spaced spline.dwg Quote
devitg Posted August 7, 2023 Posted August 7, 2023 48 minutes ago, devitg said: @noyajr some like it . it s spaced in 25 equal parts , one spaced spline.dwg 27.53 kB · 0 downloads @noyajr It seem it could be so spaced spaced spline.dwg 1 Quote
marko_ribar Posted August 7, 2023 Posted August 7, 2023 Look for (vlax-curve-getclosestpointtoprojection) function... You make line horizontaly like in your picture, then measure - 1.0, then (foreach pt pts => (setq ptn (vlax-curve-getclosestpointtoprojection spline pt '(0.0 1.0 0.0)))... So ptn are your new points on spline - then just use (entmake) or POINT command to place them on spline... 1 Quote
noyajr Posted August 8, 2023 Author Posted August 8, 2023 15 hours ago, devitg said: @noyajr It seem it could be so spaced spaced spline.dwg 58.28 kB · 2 downloads Yes this is perfect for me, but i have alot of these splines with very different lengths, so is there a way to do this spacing each 1m or any other distance ? Quote
asdfgh Posted August 13, 2023 Posted August 13, 2023 (edited) Any news about this topic ? Edited August 13, 2023 by asdfgh Quote
hosneyalaa Posted August 13, 2023 Posted August 13, 2023 On 8/7/2023 at 11:08 PM, marko_ribar said: Look for (vlax-curve-getclosestpointtoprojection) function... You make line horizontaly like in your picture, then measure - 1.0, then (foreach pt pts => (setq ptn (vlax-curve-getclosestpointtoprojection spline pt '(0.0 1.0 0.0)))... So ptn are your new points on spline - then just use (entmake) or POINT command to place them on spline... AS @marko_ribar SAY @asdfgh TRY THIS (defun c:Spline_Copy (/ ACADOBJ CONTROLPOINT CONTROLPOINTN DOC ENAME INT IPOINT LEN OBJENTGET OBJOBJECCOPYT OBJOBJECT POINT1 POINT2 PT1 PTN STT ) (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-activedocument acadObj)) (if (and (setq objENTGET (entget (setq eName (car (entsel "\nSelect"))))) (setq int (getdist "\nSpecify spacing interval: ")) ) ;_ end of and (progn (setq objobject (vlax-ename->vla-object eName)) (setq objobjeccopyt (vla-copy objobject)) ;; Define the points that make up the move vector (setq point1 (vlax-3d-point 0 0 0) point2 (vlax-3d-point 0 0 -5) ) ;_ end of setq (vla-move objobjeccopyt point1 point2) (setq iPoint 0) ;_ end of setq (while (> (vla-get-numberofcontrolpoints objobjeccopyt) iPoint) (progn (setq controlPoint (vlax-safearray->list (vlax-variant-value (vla-getcontrolpoint objobjeccopyt iPoint) ) ;_ end of vlax-variant-value ) ;_ end of vlax-safearray->list ) ;_ end of setq (setq controlPointn (vlax-3d-point (car controlPoint) (cadr controlPoint) 0 ) ;_ end of vlax-3d-point ) ;_ end of setq (vla-setcontrolpoint objobjeccopyt iPoint controlPointn) (vla-update objobjeccopyt) (setq iPoint (1+ iPoint)) ) ;_ end of progn ) ;_ end of while (setq len (vlax-curve-getdistatparam objobjeccopyt (vlax-curve-getendparam objobjeccopyt) ) ;_ end of vlax-curve-getDistAtParam ) ;_ end of setq (setq stt 0) ;_ end of setq (while (<= stt len) (progn (setq pt1 (vlax-curve-getpointatdist objobjeccopyt stt)) (setq ptn (vlax-curve-getclosestpointtoprojection objobject pt1 ;'(0.0 1.0 0.0) '(0.0 0.0 1.0) ) ) ;_ end of setq ;;; (entmakex (list '(0 . "POINT") (cons 10 ptn) (cons 8 "00-point") ) ;_ end of list ) ;_ end of entmakex (setq stt (+ int stt)) ) ;_ end of progn ) ;_ end of while (vla-delete objobjeccopyt) ) ;_ end of progn ) ;_ end of if (princ) ) ;_ end of defun ;|«Visual LISP© Format Options» (72 2 50 2 T "end of " 60 9 1 0 0 nil T nil T) ;*** DO NOT add text below the comment! ***|; 1 Quote
maahee Posted August 15, 2023 Posted August 15, 2023 How to find intersect point of two selected line Quote
Steven P Posted August 15, 2023 Posted August 15, 2023 Simple with the inters command: http://docs.autodesk.com/ACD/2013/PTB/index.html?url=files/GUID-A181D474-F817-4550-86E9-87649262FA8A.htm,topicNumber=d30e610867 Bit more complex: Vla-intrsectwith A bit better with Lee Macs Intersection functions: http://lee-mac.com/intersectionfunctions.html 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.