Adding undo-redo to my extension

Every single operation what causing model to change, will be recorded to undo stack.

It is a developer responsibility to wrap multiple model changes caused by the same user action into a single undo operation using Sketchup::Model#start_operation and Sketchup::Model#commit_operation.

Actually you can make not only one but more “own club” of undo operations, if your tool is complex and you feel it is necessary.
If you do not include an operation what caused a model change that will be still recorded and will shown as independent Undo action on UI.

So, no, it is not possible to avoid extra transactions and yes, please “*club them* with your transaction so that the end-user can use a smooth and organic operation.”

Homepage | SketchUp Developer extension-ux-guidelines


Ps. I put back your topic to the right category.

1 Like