Steven P Posted August 2, 2022 Share Posted August 2, 2022 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 Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 2, 2022 Share Posted August 2, 2022 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. 2 Quote Link to comment Share on other sites More sharing options...
Steven P Posted August 2, 2022 Author Share Posted August 2, 2022 Perfect, thanks. 1 Quote Link to comment Share on other sites More sharing options...
devitg Posted August 3, 2022 Share Posted August 3, 2022 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 Quote Link to comment Share on other sites More sharing options...
mhupp Posted August 3, 2022 Share Posted August 3, 2022 5 minutes ago, devitg said: Which System variable hold the point where the user do the SSGET (defun C:test () (setq ss (ssget "_:S" '((0 . "LWPOLYLINE")))) (ssnamex ss) ) http://docs.autodesk.com/ACD/2011/ENU/filesALR/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-6933.htm 1 Quote Link to comment Share on other sites More sharing options...
devitg Posted August 3, 2022 Share Posted August 3, 2022 Ok , got it . A new one . (defun C:test () (setq ss (ssget "_:S" '((0 . "LWPOLYLINE")))) (setq point (last (last(car (ssnamex ss))))) ) 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.