Object Id from Undo event

Hi

I’m a bit stuck trying to get RhinoObjects participating in Undo/Redo event. I subscribed to Rhino.Commands.Command.UndoRedo event expecting to find something like “TheObject” in UndoRedoEventArgs but there’s only a CommandId property.

Is there a way to find out which Rhino objects were undone?

Thanks,
Max

Hi @archimax,

Have a look at RhinoDoc.UndeleteRhinoObject.

– Dale

Thanks Dale,
I’m looking into it. But it seems the event is not triggered when an object is actually beeing deleted in undo or redo action. I assume there’s nothing to Un-delete here.

There’s also no un-delete when undoing property change

Each modification of doc object create sequence of events such as undoredo, add, replace, delete, undelete. You could investigate which sequence corresponds to modification you are looking for. Then track events and take action when specific sequence has been trigerred.