Hi all, I'm writing some codes to calculate distance between two points on the polyline, :
(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))
It's not working right anywhere of polyline, for example in this polyline, it gives the correct distance : (first image)
But it gives the distance from start point of the polyline, while it should calculate minimum distance between pt1 and pt2, not from startpoint : (second image)
Is it possible to write a function or correct my codes to calculate distance between two points of anywhere on the polyline?