ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DB Object deleting

4 REPLIES 4
Reply
Message 1 of 5
leonimas
524 Views, 4 Replies

DB Object deleting

Hi to all,

I need to mask the normal delete command of a db entity; my problem is:

the user select a db object, press the "canc" key and my arx code resolves

the deleting action ...

 

If some constraints are true the code delete the object, otherwise not, the

erase command will not work.

 

Please, how can I solve this problem ? Reactors ? Which event (erased,
unappended, ... )
 
Best regards
Leonard
4 REPLIES 4
Message 2 of 5
Anodl
in reply to: leonimas

Hi Leonard,

 

override AcDbObject::subErase (or use AcDbObjectOverrule::erase) to intercept the erase procedure and to prevent the object form being erased, if necessary.

 

Arnold

Message 3 of 5
leonimas
in reply to: Anodl

Hi Arnold,

 

your solution is only valid to custom class derived from AcDbObject and/or

AcDbEntity ? If I use native class such as AcDbBlockReference or AcDbPolyLine ?

 

Many Thanks

Leonard

Message 4 of 5
Anodl
in reply to: leonimas

Leonard, for native ARX classes or other third party classes use AcDbObjectOverrule::erase, for your own classes you can override AcDbObject::subErase. HTH Arnold
Message 5 of 5
leonimas
in reply to: Anodl

Hi Anodl,

there is an example how to use the AcDbObjectOverrule class ? Must I derive

a my class from it ? where I have to instantiate the erase method (inside

ObjectARX EntryPoint class) ?

 

Many Thanks

Leonard

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost