Ahankhah Posted February 4, 2012 Posted February 4, 2012 Hi CAD lovers, Is it possible to distinguish between drawn objects (created by commands like: LINE, CIRCLE, ARC, ...) and constructed objects (created by commands like: OFFSET, FILLET (with radius), Chamfer (with distance), COPY, MIRROR (retaining source objects), ...)? Any help greatly appreciated. Quote
Lee Mac Posted February 4, 2012 Posted February 4, 2012 First thing that springs to mind: Use a Command Reactor with multiple Events: CommandWillStart Event: Callback function records the 'entlast' entity CommandEnded Event: Callback function collects a list of all entities created after the recorded 'entlast' entity using 'entnext'. The name of the command is the first item in the list supplied to the second argument of the Callback function - this allows you to determine how the entities were created. CommandCancelled / CommandFailed Events: Nullify the recorded 'entlast' entity. Quote
Ahankhah Posted February 4, 2012 Author Posted February 4, 2012 Lee, thank you very much for your explanation in plain English (as always). But there are some ambiguities: 1- What happens if someone makes a new object without invoking any command (via VLisp or ARX code)? 2- Is it possible to modify the new object before command ends. For instance, when OFFSET command is active, how possible is changing new objects' general properties (layer/color/linetype/lineweight etc.)? 3- ... Again, I appreciate your nice offer. Quote
Lee Mac Posted February 4, 2012 Posted February 4, 2012 1- What happens if someone makes a new object without invoking any command (via VLisp or ARX code)? Use a LISP reactor to monitor for LISP Events - same logic as for the Command Reactor. 2- Is it possible to modify the new object before command ends. For instance, when OFFSET command is active, how possible is changing new objects' general properties (layer/color/linetype/lineweight etc.)? Since you have the list of created entities in the CommandEnded callback function, these entities can be modified using the usual entity modification methods (entmod). 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.