Can AddCustomUndoEvent be used outside of a Rhino Command?

I’m trying to use a CustomUndoEvent to wrap changes to custom object data inside of my Plugins UI. I have found if I wrap the change in a command, I can add it to a CustomUndo/CustomRedo chain, however I have found trying to do this outside of a command does not work.

–cs

Hi @csykes,

Use RhinoDoc.AddCustomUndoEvent.

– Dale

1 Like

Hi @dale,

I’m aware of this method, I just wanted a little clarification to know if it can be registered and used outside of a Rhino Command?

– cs

Hi @csykes,

Yes, it can be used outside of a command.

– Dale

1 Like

You’ll also have to let rhino know about this using Begin/End UndoRecord

3 Likes

Thanks @menno this solves my problem, I’d tried using it outside a command and I just could not make it work :blush: