- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a script that displays a dialog box with multiple parameters and then creates an object according to those parameters. The user can check the result, modify the parameters and see the result again and again until he's satisfied.
The problem I'm facing is that an object that is created in the (value changed) event handler, does not persist. It disappears from view (and the sketches list) as soon as the event handling terminates.
I have created a small version of the script (see then attached document) to demonstrate the problem:
In the notify() function of ValueChangedHandler()
after the message box is displayed and user clicks Ok, the segment disappears.
what is the problem ?
Edit: Every sketch added before cmdDef.execute() in the main thread survives. Sketches added after the dialog box is displayed -even if the sketch is added in the same main thread- is deleted when I close the dialog box. So it does not matter if the sketch is added in an event handler or not, it will be discarded at the end.
Solved! Go to Solution.