Hello everyone,
I have a question about what adsk.autoTerminate() capabilities are in a script.
I am working on running a script through an add-in. The script creates a new occurrence with a simple cube. However, right after running the script, the design disappears. I was thinking perhaps this command may help my design stay active for further integrations.
Solved! Go to Solution.
Solved by ekinsb. Go to Solution.
I'm curious how you're executing a script from an add-in. My only guess is that your somehow starting a script from the execute event of a command and that's terminating your command, which aborts anything that it's done so far.
Is there ways to stop the termination process for these side scripts, without disconnecting them from the execution event. The execution event is needed to run the code with it's sub-processes.
I don't understand what your trying to do. What do you mean by a "side script" and "disconnecting"? How are you executing the scripts?
I am working with a friend. And we are importing the script into the add-in with the simple 'import script' line. In our add-in we have CommandCreatedEvent, ExecuteCommandEvent, and InputChangedEvent. We connected the CommandCreatedEvent to the other two events, and added some addBoolValueInput commands to create a GUI with buttons. In the InputChangedEvent we have :
Then outside the InputChangedEvent we have :
def place1():
try:
script.run(context)
Our script just creates a rectangular sketch. As soon as we run the add-in it does run the script and creates the sketch. However right after it creates it,it disappears but we want it to stay in the design.
What you're seeing is a result of how commands work. Whatever you do in events besides the execute event will be aborted. The command framework is designed to collect a set of input and then create the single final result at execution. However, we are enhancing the command functionality in the future in a way that I think you might be able to accomplish your desired affect, but not exactly in the same way as you're currently trying to do it. These new enhancements should be out in the update at the end of May.