TheSwamp
CAD Forums => CAD General => Topic started by: jonesy on May 19, 2015, 06:20:44 AM
-
We have a "jobette" to do where we need to be able to find the distances of objects along a pline. All the distances need to be from the start point of the pline. Unfortunately the pline twists and turns multiple times... is there something I have overlooked in enabling me to pick the start position and the position of the object and get an accurate distance?
-
Here's a quick LISP to help you:
(defun c:pdist ( / e p )
(if (setq e (car (entsel "\nSelect object to measure: ")))
(while (setq p (getpoint "\nPick point on object: "))
(princ
(strcat "\nDistance from start point: "
(rtos
(vlax-curve-getdistatpoint e
(vlax-curve-getclosestpointto e (trans p 1 0))
)
)
)
)
)
)
(princ)
)
(vl-load-com) (princ)
-
Oh thanks Lee, I'll give it a go.
-
You're welcome! :-)
There is also this (http://www.theswamp.org/index.php?topic=32677.0) by alanjt.