DeleteRhinoObject rises when object is moved

I’ve found that Rhino.RhinoDoc.DeleteRhinoObject event is rised when object simply moved from one position to another by user
Is that a bug or how exactly identify that object was deleted?

I think it is not a bug. If an object is moved the old one will be deleted and a new one will be created with exactly the same attributes incl. its guid.

Correct, changes to objects in the document always raise the DeleteRhinoObject, AddRhinoObject and ReplaceRhinoObject events. You’ll have to handle all three events and store the object ID between them to see whether an object was actually deleted or whether that deletion was only part of a replacement.

Can you provide an example of “handling all three events” to detect “real” deletion events? I don’t quite see how that’s supposed to work without having some of timer mechanism that times out deletion events to identify them as “real,” which seems pretty error-prone and clunky.

What language do you want the example in?

C# would be ideal. Thanks!

If both RhinoDoc.UndoActive() and RhinoDoc.RedoActive() return false, then immediately after the RhinoDoc.ReplaceObject event, there will be a RhinoDoc.DeleteObject event followed by a RhinoDoc.AddObject event.

If either RhinoDoc.UndoActive() or RhinoDoc::RedoActive() return true, then immediately after the RhinoDoc.ReplaceObject event, there will be a RhinoDoc.DeleteObject event followed by an RhinoDoc.UndeleteObject event.