Erasing objects

Erasing objects

Anonymous
Not applicable
306 Views
2 Replies
Message 1 of 3

Erasing objects

Anonymous
Not applicable
I need to intercept the autocad erase command and check to see if the object contains one of my blocks. I already have the the code written to see if it is own by me. for example lets use the function is_it_mine(); I would like to catch the erase command, call is_it_mine() before the erase is done, if it is mine I need to delete it from an external database as well (which I can handle). I am basically needing help on the event handler to capture the erase command. Does anyone have any sample code? Thanks, Rob
0 Likes
307 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Hi Rob,
i think you need a AcDbDatabaseReactor, look at the example 
samples\editor\mfcsamps\modeless in your ObjectARX directory.
Regards, Petra

Rob Thyen wrote:
> I need to intercept the autocad erase command and check to see if the object
> contains one of my blocks.  I already have the the code written to see if it
> is own by me.  for example lets use the function is_it_mine();
> 
> I would like to catch the erase command, call is_it_mine() before the erase
> is done,  if it is mine I need to delete it from an external database as
> well (which I can handle).  I am basically needing help on the event handler
> to capture the erase command.  Does anyone have any sample code?
> 
> Thanks,
> 
> Rob
> 
> 
0 Likes
Message 3 of 3

Anonymous
Not applicable
Hi!
pfluegge is right. You need to work with AcDbDatabaseReactor and override the AcDbDatabaseReactor::objectErased() or AcDatabaseReactor::objectUnAppended notification.
Read the objectARX documentation for more details.
see ya!
0 Likes