Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lifecycle of a script

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
jaegeraxel
345 Views, 2 Replies

Lifecycle of a script

Hello,

I am working on a script that might someday be useable for other people and I wonder how to deploy it. I use python for developing my script. 

 

Currently, I have a main-method and when I run my script, I create my geometry and then my script is done. However, each and everytime I restart my script, spyder asks me whether I want to start a second instance, so obviously my script does not exit although I call 

adsk.terminate() within my script. 

 

I see also that in the example bolt, there is some command pattern that registers a command object, so here the script does not simply run through from top to bottom.

 

Is there any documentation on how this is supposed to work? My goal is to have in the end a button in the user interface that does something.

 

But do I somehow add a button and on each click my scripts is started again or does my script run once but adds the button to the ui itself and then waits for clicks? 

 

2 REPLIES 2
Message 2 of 3
prainsberry
in reply to: jaegeraxel

THis will all work a little bit better and be a little bit more clear after the next Fusion release in a couple weeks.  At that time we will support "Add-in" development in the API.  THis will allow you to develop a script that loads itself into the UI automatically everytime you start Fusion.  It can have buttons, etc that are placed in the UI to execute tasks.  THe documentation for this should be ready with the release.



Patrick Rainsberry
Developer Advocate, Fusion 360
Message 3 of 3
jaegeraxel
in reply to: prainsberry

I am looking forward for the next release to see how the API works. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report