Jump to content

Distance point to polyline


Steven P

Recommended Posts

Good afternoon,

 

Hope this is a quick one, I want to check if a point that a user has selected is on a polyline or not. I am sure this is dead simple and there -should- be a copy and paste solution out there, be grateful if anyone has something they can share..... if not subtle hints are also good and a great way for me to learn a bit more.

 

The polyine will have been selected with a single click ssget: (setq obj1 (ssget "_:S" '((0 . "LWPOLYLINE"))) )

 

Thanks

Link to comment
Share on other sites

You can use the function vlax-curve-getclosestpointto to check if the distance between the picked point and closest point to object is equal to zero then its on otherwise its not.

 

  • Like 2
Link to comment
Share on other sites

On 8/2/2022 at 9:25 AM, Tharwat said:

You can use the function vlax-curve-getclosestpointto to check if the distance between the picked point and closest point to object is equal to zero then its on otherwise its not.

 

Which System variable hold the point where the user do the SSGET ?

(setq obj1 (ssget "_:S" '((0 . "LWPOLYLINE"))) )

 

For Entsel is known 

 

(setq point ( cdr (entsel "\n Select an entitytie" )))

Thanks in advance 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...