Hi
I have a list of points :
(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)))
I want connect them to each other by line (not by polyline),so I wrote a function but it fire up an error on
(VLAX-3D-POINT (NTH (+ 1 i) lst2)) .
Please somebody tell me about this error and how to fix it .
(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