Message 1 of 3
What is event API to close and then re-create an Add-In under Python control?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I think I need to fire a couple events. I am using "custom events" already so I don't think this should be too hard:
- Simulate the user clicking on the "Close" button from inside my Python add-in.
- Simulate the user opening it again from the Fusion 360 menu.
The UI is is built in the CommandCreated event handler based somewhat on the contents of a disk file. If the user wants to read in a different file then the UI must be re-created. The proposed pseudo code is:
- Ask if any changed data should be saved into a file.
- Use the file open dialog to locate the file to open
- Set the file name where it will be caught in the Command Created event.
- Close the add-in dialog
- Select the add-in from the menu (say, "Utilities" --> "My Thing")
- Read the file name from step 3 instead of using the defaults
I have a feeling this was already answered but I didn't happen to spot it.