Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

Posted
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).

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...