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: 

Visual Studio Code tutorial

22 REPLIES 22
SOLVED
Reply
Message 1 of 23
hpekristiansen
7873 Views, 22 Replies

Visual Studio Code tutorial

Fusion 360 API is now using Visual Studio Code instead of a very old version of Spyder - I am happy.

 

The problem now is that I have not used Visual Studio Code before, and I do not know how VSC with Fusion differs from running generic Python in VSC. I can not even do a simple thing like running a script(from within VSC). How do I do that?

 

Do I need to install something special/make special settings like written here:

https://stackoverflow.com/questions/29987840/how-to-execute-python-code-from-within-visual-studio-co...

 

Here something is written about a needed extension, but I do not want to install something, if it is wrong for Fusion:

https://code.visualstudio.com/docs/python/python-tutorial

 

In the "What's new", it says "For more information about this, check out our help documentation. "

https://www.autodesk.com/products/fusion-360/blog/september-23-2019-product-update-whats-new/

 

Where is this help? 

 

22 REPLIES 22
Message 21 of 23
goyals
in reply to: Anonymous

It is already done and changes were delivered as part of Fusion April release. You can upgrade to latest extension from VSCode itself. Thanks.



Shyam Goyal
Sr. Software Dev. Manager
Message 22 of 23
therealsamchaney
in reply to: goyals

@goyalsCould you please provide an update as to where this issue is at currently in 2022? I still can't figure out how to get Fusion 360 scripts and add-ins to run from VSCode or see print statements or debugging.  I don't understand your instructions as there is no such thing as "edit mode" in VSCode. If I try to run a script from VSCode by clicking the play button, I of course get an error saying there is no such module named "adsk". If I try to run without debugging, I get an error message "noDebug" is not supported for "attach". I have installed both Fusion 360 related extensions for VSCode but they often don't work since they only recognize files that have a manifest file, which only works for the root python file of an add-in, which is no longer how add-ins are structured for python. Now we put commands in a commands folder which does not have a manifest file so it's not recognized by the Fusion 360 Addin Helper extension.

 

Thanks!

-Sam

Message 23 of 23

Hi @therealsamchaney .

 

I think you have a different procedure for debugging.
You can find an explanation here in the documentation.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-743C88FB-CA3F-44B0-B0B9-FCC378D0D782 

 

1.png
VSCode must be started from the "Scripts and Add-Ins" dialog in Fusion360.
VSCode should be executed in the red area, not in the yellow area.
Re-execution is in the green area.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report