Operations not commited
-
Hi all,
I got a problem with committing an operation inside a sketchup plugin. To reproduce:
` model = Sketchup.active_model
model.start_operation 'updateName'
@some_component.name="newName"
model.commit_operationmodel.start_operation 'hide_all_except'
@some_component.instances[0].hidden = true
model.abort_operation`Both operations are aborted.
It is a simplification, there are more operations but none of them are model.*_operation related.
What I am doing wrong? -
(1) It's easy to see why the 2nd op is aborted because you call
model.abort_operation
instead of committing it.(2) Perhaps some other plugin is also creating ops and "gluing" their's transparently between your 2 ops ??
- I always disable all other 3rd party plugins when developing!* (But I leave the OEM Dynamic Components extension ON.)
(3) Do yourself and us a big favor.. wrap your operations and trap any errors that cause the ops to abort.
Advertisement