Reputation: 556
I am new to Object ARX and currently I try to code in C# using Visual Studio 2012. The other day I encounter this method (not a bug or an actual coding problem but it keeps me wondering):
DBObject::Erase();
DBObject::Erase(bool erasing);
I wonder what is/are the differences between the 2 methods? When to use/ not to use a specific one?
I did some research and found that the later method does not actually erase the object but only marks it as "deleted" so that it won't appear or be filed when the drawing is saved if I set bool erasing = true
. On the other hand, if I set bool erasing = false
, the object can be recover (it is still exist in memory). I still don't truly understand the first method, though.
My research lead to an other question: How to recover the erased object using the second method? The other I encounter a method looks like this
_recover (parameter1, parameter2, parameter3, parameter4);
but I can not seem to find it again. What is this method and how to use it?
Any explanations, ideas or references are much appreciated.
Upvotes: 0
Views: 548
Reputation: 556
The answer to this question is the method itself. Once "erasing" is set to true, the object will be mark as "erased", but only when we save the drawing, the object is actually erased. Otherwise, it remains in the database, but it takes no commands or interactions form user. As long as the drawing is not saved, we can call the method again as
object.Erase(false);
to set the object as "not erased". This is from the object ARX docs, file name arxref.chm . The document of autocad .NET does not provide much detail about this except the short description :
"Setting the erase flag on/off"
Upvotes: 0