Script to paste objects along a polyline at defined distance
I'm looking to make a lisp which will create a coneline, so once ran the cone block will be grabbed from a different dwg file and pasted on to a selected polyline at a user defined distance
I'm rather new to lisp so not got a huge knowledge, I've got a small idea but still learning.
If anyone could help / point me in the right direction that would be perfect
current code:
Thanks,
I'm rather new to lisp so not got a huge knowledge, I've got a small idea but still learning.
If anyone could help / point me in the right direction that would be perfect
current code:
(defun c:coneline (/ d1 d2 dis ent op pt1 pt2 tl tot)
(setq ent (car (entsel "\nSelect polyline: "))
pt1 (getpoint "\nStarting point :")
pt2 (getpoint "\nDirection point: ")
dis (getdist "\nDistance: ")
tot 0
op (if (minusp (- (vlax-curve-getdistatpoint ent (vlax-curve-getclosestpointto ent pt2))
(setq d1 (vlax-curve-getdistatpoint ent (vlax-curve-getclosestpointto ent pt1)))))
-
+)
tl (if (= op -)
(vlax-curve-getdistatparam ent (vlax-curve-getstartparam ent))
(vlax-curve-getdistatparam ent (vlax-curve-getendparam ent))))
(while ((if (= op -)<del class="Delete"></del>
>=
<=) (setq d2 (op d1 tot))
tl)
(command "._-insert" "Cone" (setq pt1 (vlax-curve-getpointatdist ent d2)) 0.4 0.4 0)
(setq tot (+ tot dis)))
(princ)
)
Is there a way I can do this without it printing anything inside the command bar/logThanks,
0
Comments
-
Look at the NOMUTT setting in help.0
