hello,
i have read some topics about the following problem already, but found no answer,
so:
when i start an operation and create some geometry during this process (like a line following the mouse),
i am still within this operation, unless i click for the second time and commit via
model.commit_operation.
this work well.
but now i found out, that
after click 1 , which calls my own model. start_operation,
the user can for example
select another layer or create a layer and so on in skecthup menues (while he is inside my operation).
those actions themselves write into the undo-stack, as far as i can see
and my commit does not work anymore.
please, can you give me any advice, how to solve this? is there a way to “remove entries” from the undo stack whithout undoing the “external” actions?
setting up observers does not help, since then the actions are already done.
thanx in advance for any help!
stan
ps: in this topic
https://forums.sketchup.com/t/difficulties-wrapping-the-operations-of-a-plugin-into-one-undo/15657/2
greg wrote:
Francis,
As mentioned, you can combine all your operations. Also, you can create a counter for the number of operations added to the stack, then do
1.upto(cntr_ops) { Sketchup.undo }
to remove them.
Greg
but i cannot apply this for now…(do not understand, how to implement the code)