Visual Studio Code tutorial

Visual Studio Code tutorial

hpekristiansen
Advocate Advocate
12,091 Views
22 Replies
Message 1 of 23

Visual Studio Code tutorial

hpekristiansen
Advocate
Advocate

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? 

 

0 Likes
Accepted solutions (2)
12,092 Views
22 Replies
Replies (22)
Message 21 of 23

goyals
Autodesk
Autodesk

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
0 Likes
Message 22 of 23

therealsamchaney
Advocate
Advocate

@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

0 Likes
Message 23 of 23

kandennti
Mentor
Mentor

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.