Topic: Looking for closest points between two polylines
https://www.theswamp.org/index.php?topic=50829.0ARX
(if (and (setq e1
(xdrx
-entsel "\nPick first curve<exit>:" '
((0 .
"*line,arc,ellipse,circle")))) )
(setq e2
(xdrx
-entsel "\nPick second curve<exit>:" '
((0 .
"*line,arc,ellipse,circle")))) )
(setq g1
(xdge::constructor e1
)) (setq g2
(xdge::constructor e2
)) (setq p1
(xdge::getpropertyvalue g1
"ClosestPointTo" p1
)) (setq p2
(xdge::getpropertyvalue g2
"ClosestPointTo" p2
)) (setq pt1
(xdge::constructor
"kpointoncurve3d")) (setq pt2
(xdge::constructor
"kpointoncurve3d")) (setq a
(xdge::getpropertyvalue
g1 "getClosestPointto" g2 pt1 pt2)
)
)
(xdrx-begin)
(xdrx-line-make
(setq p1
(xdge::getpropertyvalue
(car a
) "point")) (setq p2
(xdge::getpropertyvalue
(cadr a
) "point")) )
(xd::pnt:mark p1 2 0.008)
(xd::pnt:mark p2 2 0.008)
(xdrx
-prompt (xdrx
-string
-format
"\n####Two Curve ClosestDistance is: %.2f ####" (distance p1 p2
))) (xdrx-end)
)
)
)