(DEFUN Dst (lst2 / i lin ds endpt startpt midpt str)
(SETQ i 0)
(WHILE (< i (- (LENGTH lst2) 1))
(SETQ lin (VLA-ADDLINE
(VLAX-3D-POINT (NTH i lst2))
(VLAX-3D-POINT (NTH (+ 1 i) lst2))
) ;_ end of VLA-ADDLINE
) ;_ end of setq
(SETQ ds (VLA-GET-LENGTH lin)
startpt (VLAX-GET lin 'startpoint)
endpt (VLAX-GET lin 'endpoint)
midpt (POLAR endpt (ANGLE endpt startpt) (/ (DISTANCE endpt startpt) 2.0))
str (vla-addtext midpt 1 (RTOS ds 2 2))
) ;_ end of setq
(VLA-PUT-ROTATION str (VLA-GET-ANGLE lin))
(SETQ i (1+ i))
) ;_ end of while
(PRINC)
) ;_ end of defun
Thanks ronjonp for your reply
Your code is very interesting,but I want do it by vla-addline method . please tell me about that .
(setq lst '((5.79273 22.3288 120.0)
(16.4714 12.039 125.0)
(33.6864 7.97628 125.0)
(45.9991 13.5198 125.0)
(45.9991 14 125.0)
)
)
(command "_line")
(while (= (getvar "cmdactive") 1 )
(repeat (setq x (length lst))
(command (nth (setq x (- x 1)) lst))
)
(command "")
)