Thế Long
Thế Long

Reputation: 556

DBObject: Erase and recover objects

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);
  1. 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.

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

Answers (1)

Thế Long
Thế Long

Reputation: 556

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

  1. Sorry for the confusion, the method I saw earlier is actually the reactor/ event handler for the erase event in object ARX/ autocad .NET .

Upvotes: 0

Related Questions