ILoveMadoka Posted October 20, 2018 Posted October 20, 2018 Is it possible to extract the coordinate point where the selection was made from this code?'' (setq obj (vlax-ename->vla-object (car (entsel "\nSelect object: ")) ) ) Quote
Lee Mac Posted October 20, 2018 Posted October 20, 2018 (edited) The selection point (specifically, the centre of the pickbox aperture) is the second element (cadr) of the list returned by entsel, therefore, you will need to change the code to something like this (obviously with additional testing to account for null input): (setq sel (entsel) pnt (cadr sel) obj (vlax-ename->vla-object (car sel)) ) Note that since the point returned is the centre of the pickbox aperture, such point may not necessarily lie on the selected object; to solve this, you can use the vlax-curve-getclosestpointto function in conjunction with the entity & point returned in the entsel list in order to obtain a point on the selected object closest to the centre of the selection aperture, but this will only work for curve objects; for others, you can use the osnap function with the "_nea" mode. Edited October 20, 2018 by Lee Mac Quote
ILoveMadoka Posted October 21, 2018 Author Posted October 21, 2018 Thank you Lee!! I found a routine very similar to your Double Offset command http://www.lee-mac.com/doubleoffset.html But the other routine caps the ends of the newly offset entities creating a closed boundary which is what I needed. Unfortunately some of their code is really hard for me to follow. Not that I can follow many of yours either... Autolisp? So-so. VLisp? Not really. I was originally going to ask you if adding that functionality to your routine would be too much to ask.. I need to hatch the interior of that new boundary which represents a "line" that is being removed.That is why I was asking how to locate that "interior" point. To use with my hatch command. Thank you so much for your help. I hope I can get my modification to work. If not, I'll be back with more questions... Quote
Lee Mac Posted October 21, 2018 Posted October 21, 2018 4 minutes ago, ILoveMadoka said: But the other routine caps the ends of the newly offset entities creating a closed boundary which is what I needed. I was originally going to ask you if adding that functionality to your routine would be too much to ask.. I need to hatch the interior of that new boundary which represents a "line" that is being removed.That is why I was asking how to locate that "interior" point. To use with my hatch command. Something like this? Quote
ILoveMadoka Posted October 21, 2018 Author Posted October 21, 2018 I'm sitting here laughing... You are so friggin' AWESOME!! Once again, MY HERO!! Thank you Sir! Quote
Grrr Posted October 21, 2018 Posted October 21, 2018 FWIW, another way: (if (mapcar 'set '(ent pnt) (entsel)) (setq obj (vlax-ename->vla-object ent)) ) 1 Quote
Lee Mac Posted October 21, 2018 Posted October 21, 2018 10 hours ago, ILoveMadoka said: I'm sitting here laughing... You are so friggin' AWESOME!! Once again, MY HERO!! Thank you Sir! Thank you for your kind words - you're most welcome! Quote
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.