I have formatted it in such a way that each entry in the file is the distance to each vertex in turn (from the start of the curve), hence the distance from the start vertex to the start vertex is always zero.. - I probably could have ignored this point, but I wanted the number of distances to equal the number of points... with the length being the last entry.
Hi friends,
This is what I wanted from ages!!
but I nneed result that means segment lengths as stored in variables as that I can assign them as values of attributes in a block!
Can we do this!
(defun C:TEST ( / SegmLen ss lst) (defun SegmLen (e / i l) (repeat (setq i (fix (vlax-curve-GetEndParam e))) (setq l (cons (apply '- (mapcar '(lambda (x) (vlax-curve-GetDistAtParam e x)) (list i (setq i (1- i))))) l)) ) ) (if (setq ss (ssget ":E:S" '((0 . "*POLYLINE")))) (progn (setq lst (SegmLen (ssname ss 0))) (princ lst) ;just to show result ;do whatever you want with lst variable ) ) (princ))