Hi dear Lee and other members
I still have not seen your solution and involved by myself problem solving...!
I almost solved this problem , but now I have an incredible problem :
I've run this codes over 10 different examples and , at all of them , information of first point emitted , namely if I have a 3dpolyline with 5 vertex and 4 segment this codes extract information from the second point onwards !
This story is too strange for me , have you ever had such a problem ?
I thank if you or someone show me my wrongs and errors
;; ======================================================
;
(defun C:PT ( / en enlist ptlist en2 enlist2 pxy pz dis)
(setq en (car (entsel "\n Select a 3D PolyLine : ")))
(setq enlist (entget en))
(setq ptlist (list))
(setq en2 (entnext en))
(setq enlist2 (entget en2))
(while
(not (equal (cdr (assoc 0 (entget (entnext en2)))) "SEQEND")
)
(setq en2 (entnext en2))
(setq enlist2 (entget en2))
(if (/= 16 (cdr (assoc 70 enlist2)))
(setq
ptlist
(append ptlist (list (cdr (assoc 10 enlist2))))
) ;setq ptlist
) ; end if
) ;end while
(foreach e ptlist
(setq pxy (cons (list (car e) (cadr e)) pxy)
pz (cons (caddr e) pz)
) ;setq pxy
) ;foreach
(setq n (- (length pxy) 1)
i 0)
(while (/= i n)
(setq dis (cons (distance (nth i pxy) (nth (+ i 1) pxy)) dis)
i (1+ i))
) ;end while
(terpri)
(princ dis)
(princ ptlist)
(princ (reverse pxy))
(princ (reverse pz))
(princ)
) ;defun