adc111 Posted June 5, 2012 Posted June 5, 2012 I have a third party (ARX) command that I need to use in an AutoLISP program, and the first thing the command does is an (entsel) to get an entity to work on. Trying to figure out if there is a way that I can programmatically pass an entity to it from a selection set in my program. I know that (entsel) can accept a point, so I can grab a point from my entity (polyline) and pass that along: (command "_.arxcmd" (list x y z) "") That seems to work, but passing a point is not 100% reliable to get the intended entity, as there could be another polyline (on same layer) that is overlapping, and thus might be selected instead. Unfortunately, the "arxcmd" ignores any existing selected entities on the drawing and prompts for a new one, so I can't just preselect the entity and then issue the command. I do not have access to the arx command code. Is there any way that I can pass the actual entity I want selected to a pending (entsel)? Or at least a trick that is more reliable than giving it a point? Quote
MSasu Posted June 7, 2012 Posted June 7, 2012 Seems that the said third-part tool (ARX) is defined as a command – when call it directly on prompter should see what is his prompter asking for. If is a about a point and passing an entity name doesn’t help, then I’m afraid that you have no other solution than using a point. One work-around is to perform a zoom operation centred on selection point to maximize efficiency prior calling that tool in your code. To test if the said command will accept an entity name try: (command "_.arxcmd" (car (entsel)) "") Quote
adc111 Posted June 12, 2012 Author Posted June 12, 2012 Thank you both, the ARX command accepted an entity name, that works well. 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.