Command Inputs API Sample (Python) Issues

Command Inputs API Sample (Python) Issues

mjobson32CFL
Enthusiast Enthusiast
1,471 Views
4 Replies
Message 1 of 5

Command Inputs API Sample (Python) Issues

mjobson32CFL
Enthusiast
Enthusiast

Hi, 

 

I'm trying to learn to program in Python and learn the API (i;m not a programmer), but the Command Inputs API Sample isn't fully working in Python:

 

http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-e5c4dbe8-ee48-11e4-9823-f8b156d7cd97

 

Line 39 and 99 have errors. and If i turn 99 into a comment (#) then 125 becomes a problem.. then 126 etc etc.

 

So i am guessing there is something it keeps referring to (maybe an expression) that has changed in fusion 360 in some way.

 

It's really late.. Any chance someone could send me updated code that actually works out of the box. (eg. every time i select something it shoots up error msgs.)

 

Kinda hard to learn and play in this state.

 

I want to learn it, but viewing samples in this state makes it decidedly unfun.

 

Thanks.

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

ekinsb
Alumni
Alumni

Thanks for pointing out this issue.  That sample has a dependency on some resource files but that's not identified anywhere and the files aren't easily available.  I'll see if I can correct that for the next release.  I've attached the resource files.  Just unpack the zip into the folder where the script is.  So you should see the .py and .manifest files of your script and now there should also be a "resources" folder.  Now it should work.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 3 of 5

mjobson32CFL
Enthusiast
Enthusiast

Thanks Brian,

 

Where do i find the zip?

0 Likes
Message 4 of 5

ekinsb
Alumni
Alumni
Accepted solution

It helps if I actually attach it. Smiley Happy

 

Here it is.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 5 of 5

mjobson32CFL
Enthusiast
Enthusiast

Thanks. Works nicely now.

 

I'm going to have a good look at this and your Spur Gear script.

 

Fusion has integrated scripts really nicely. If made properly, it would be hard to tell user generated scripts from the main software. That is really cool!

0 Likes