Fusion 360 Script Library?

Fusion 360 Script Library?

joecamisa
Contributor Contributor
1,061 Views
4 Replies
Message 1 of 5

Fusion 360 Script Library?

joecamisa
Contributor
Contributor

Hello Fusion 360 API and Script users.  I need to automate a Fusion 360 work process that has two basic steps for a series of 15 different scale factors.  For each of the 15 different pre-defined scale factors (envision a  basic Do Loop to accomplish):

(1) Scale a body non-uniformly along both X and Z axis using the same scale factor for both X and Z scaling.

(2) Export the body as an STL file 

 

Is there a library of Fusion 360 scripts that might include examples of:

(1) Do loops

(2) Scale body (or component?) non-uniformly

(3) export body as an STL file

 

Thanks for suggestions on where to find script source code or script examples.

 

Joe Camisa

 

0 Likes
Accepted solutions (1)
1,062 Views
4 Replies
Replies (4)
Message 2 of 5

JeromeBriot
Mentor
Mentor
Accepted solution
Message 3 of 5

joecamisa
Contributor
Contributor

Hello Jerome, thanks for the links.  I'll use these examples to build the script I need.

 

The Scale Feature script ran without error.

 

The STLExport sample ran and opened MeshMixer with the body from the Scale Feature script.  The STLExport script then fails with the following message:

 

Failed:
Traceback (most recent call last):
File "C:/Users/joeca/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/ExportTest/ExportTest.py", line 34, in run
stlRootOptions.printUtility = printUtil
File "C:\Users/joeca/AppData/Local/Autodesk/webdeploy/production/19107935ce2ad08720646cb4a31efe37d8a5f41b/Api/Python/packages\adsk\fusion.py", line 65988, in _set_printUtility
return _fusion.STLExportOptions__set_printUtility(self, value)
RuntimeError: 3 : Invalid parameter, printUtility is empty

 

Tracing back it appears that in my instance of Fusion 360 "availablePrintUtilities" is empty.

Guess I need to read more documentation to learn how to populate "availablePrintUtilities".

 

Thanks again for the links.  Once I get these working and add a For loop my script should do what I need.

 

Joe

 

 

0 Likes
Message 4 of 5

JeromeBriot
Mentor
Mentor

@joecamisa wrote:

Tracing back it appears that in my instance of Fusion 360 "availablePrintUtilities" is empty.

Guess I need to read more documentation to learn how to populate "availablePrintUtilities".

 


The availablePrintUtilities property is read only. I don't think that you can modify it.

 

Message 5 of 5

joecamisa
Contributor
Contributor

In that case sounds like I'll need to continue debugging including printing the value of relevant properties and variables at the point in which the script is failing.

0 Likes