TransformOverrule with no autodelete?

capuano3d
Enthusiast

TransformOverrule with no autodelete?

capuano3d
Enthusiast
Enthusiast

Hey everyone

 

I understand that Autodesk.AutoCAD.ApplicationServices.TransformOverrule has a read-only property AutoDelete = true, which will in all cases delete the entry entity.

 

In my case in particular I'm working with the Explode method of it, and there's in my set of rules a case where the input Entity should not be affected. I could recreate it with .Clone() and readd it to the database etc, but it's a complex entity with XData attached in it etc so something I'm trying to avoid.

 

Question:  Is there a way to deal with Autodesk.AutoCAD.ApplicationServices.TransformOverrule in a way to stop this behaviour, ie stop it deleting the Entity argument by default?

 

Happy to elaborate, thanks in advance

 

Alan

0 Likes
Reply
Accepted solutions (1)
467 Views
3 Replies
Replies (3)

norman.yuan
Mentor
Mentor

AutoDelete is the implementation of base class DisposableWrapper, it is probably used only when an runtime object (RXObject) is to be disposed. Without knowing what your overrule does, I do not know why this property concerns you, and I doubt that this property is the cause of whatever issue you have.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes

capuano3d
Enthusiast
Enthusiast

Right.

 

The particular overrule item within the code is a 'do nothing/leave as is' one. 

 

I understand I would have to do it with Clone()-ing it back, correct? 

 

Thanks

 

 

 

 

0 Likes

BlackBox_
Advisor
Advisor
Accepted solution

If you do end up Clone()-ing or use CopyFrom(), you may also want to SwapIdWith():

 

https://www.keanw.com/2008/07/swapping-identi.html



"How we think determines what we do, and what we do determines what we get."

0 Likes