Getting issue while invoke callback in separate thread in ACT
In ACT for Mechanical Context, I have a callback which is called on the button click implemented in XML:
The run() routine is initialized in .py file as
In such a case, the button is being pressed during the runtime of ACT, and UI is suspended. It looks normal because no separate thread is created for run(). Then I changed the code to run ACT in a separate thread and to release UI by putting the main code to another routing:
def main(): def internal_main(): ... thread = System.Threading.Thread(System.Threading.ThreadStart(internal_main)) thread.Start() def run(context): main()
but get the Static Structural closed with the error message "ansysWB encountered a problem ..." instead of execution!
What is the reason why the solution is crushed? Is the technique mentioned above the right way to release UI during the ACT run?