(setq obj (vlax-ename->vla-object (car (entsel))))
(setq pt1 (getpoint "\nPick the first point"))
(setq pt2 (getpoint "\nPick the first point"))
(setq ds1 (vlax-curve-getdistatpoint obj pt1))
(setq ds2 (vlax-curve-getdistatpoint obj pt2))
(setq ds (- ds2 ds1))
Polyline is closed and Distance command is not appropriate for my file, because it's possible to select two points like the image:
Isn't there any way to calculate from second point to first point ? I mean the codes gives the minimum distance between p1 to p2 and also p2 to p1.
The distance will return a +ve or -ve answer depending on point values, so maybe use (abs (- d1 d2)