Undo Issue with Rotate Operation Using OnSelect Event

Hi, I was performing rotation operations on my objects using the OnReplaceEvent with the gumball movement, and the Undo operation was working without any issues. I moved this process to the OnSelect event and, again, I am calculating an angle and performing a rotation. The rotate method I use is the same; the only change is the event, and I am no longer using the gumball. I’m not sure if this is the reason, but now my Undo operation is no longer working. I would appreciate yours help.

If you’re modifying the document outside of a command and want to be able to support Undo, you need to record an undo record. I’m assuming RhinoCommon - see

https://developer.rhino3d.com/api/rhinocommon/rhino.rhinodoc/beginundorecord
https://developer.rhino3d.com/api/rhinocommon/rhino.rhinodoc/endundorecord

1 Like

Thanks for your answer I used BeginUndoRecord at the start of my events and EndUndoRecord at the end. Everything is now working properly.

1 Like