Bugsplat after a component definition save_as

By doing exactly what you did in the example above.

The suspend() method is actually a SketchUp engine callback method that should have been named onSuspend(), but was not. So you need to let SketchUp call those callbacks.

In your case, you’d need to let the deactivate and activate callback methods to save and restore tool state. These are also called by the SketchUp engine, when you pop tool and push tool. (You do not call them directly.)

If SketchUp does not wait for the save_as() to complete, then you’d need to use a UI.start_timer block to test when the component SKP file’s modified time is updated. See File::mtime() class method. Once updated, you can then push your tool object back onto the model’s tool stack.


Please note how to post code in the forums …