Message 1 of 3
Get the closest point to a polyline segment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Autolisp has a function vlax-curve-getClosestPointTo that returns the point on a curve that is nearest to the specified point. I need the same method that can be used only for a part of a curve (polyline segment).
I can get the geometric parameters of a segment like this:
(setq
pik (entsel)
ent (car pik)
gpp (fix
(vlax-curve-getparamatpoint ent
(vlax-curve-getclosestpointto
ent
(cadr pik)
)
)
)
pt1 (vlax-curve-getpointatparam ent gpp)
pt2 (vlax-curve-getpointatparam ent (1+ gpp))
)
How can I get the closest point to the segment between points pt1 and pt2 without creating a new entity (line or polyline) from these two points?