Is it possible to undo by program?

Hi, I have a program like this.

Sketchup.active_model.start_operation "My Ext"
# Do Somthing
Sketchup.active_model.commit_operation
# I wish to undo here.

Is it possible to undo “Do Something” in program?
Thank you so much for your help.

Sketchup undo-class_method
.
.

search

2 Likes

Thank you Dezmo. I should be more careful.

1 Like

It seems instead of: Sketchup.active_model.commit_operation Sketchup.undo, You can do: Sketchup.active_model.abort_operation and it is better.

1 Like

Depends on what you want to achieve. Both usage of methods can have its own purpose.

:slight_smile:
Sarcasm mode on.
Sorry we can only answer what you have written, and not what you think about...
Sarcasm mode off.
:wink::peace_symbol:

2 Likes