How to undo from ruby?
-
Hello,
I'm trying to find a clue in order to allow to undo multiple actions that occure from a ruby script, during the execution of this script.
I don't know if it's clear enough? Imaginea user starts a script that insert component one by one, with coordinates inserted by the user (obviously, the user is just me...), but I realise I was wrong two steps ago... so I want to go back and restart, even get my variables back as it was before.Who can help?
-
Emmanuel,
You'll want read about and use:
Sketchup.active_model.start_operation "Operation name" ... Sketchup.active_model.commit_operation
and
Sketchup.undo
-
Thanks Jim,
I'll look further for that. -
Hi, Again...
But the start/commit_operation do not undo the variable that changes?
It only undo "actions" on the screen, on the model.
Then is there a way to act on the variable and undo the new value? -
@unknownuser said:
Hi, Again...
But the start/commit_operation do not undo the variable that changes?
It only undo "actions" on the screen, on the model.
Then is there a way to act on the variable and undo the new value?Emmanuel,
That is sort of an odd request. Can you elaborate on what you want to do, or post some code?
Advertisement