Resetting Environment in VSCode

Resetting Environment in VSCode

snitty
Explorer Explorer
479 Views
3 Replies
Message 1 of 4

Resetting Environment in VSCode

snitty
Explorer
Explorer

So, I was trying to debug one of my own scripts and VSCode gave me a pop-up I didn't think too hard about that seems to have disabled the proper environment when debugging scripts and add-ins? 

 

Does anyone know the right setting to toggle back so that it imports the environment that Fusion creates when it opens VSCode for debugging. I've tried switching a few things within the settings and none seem to be doing the job. 

 

Thank you

0 Likes
480 Views
3 Replies
Replies (3)
Message 2 of 4

tykapl.breuil
Advocate
Advocate

Normally to get the VScode environement you need to click the edit button in the scripts and addin window. If that doesn't work maybe try it in a new script and recreate one only copying the code.

0 Likes
Message 3 of 4

snitty
Explorer
Explorer

I didn't explain my problem well. The issue was when opening things through Fusion (using edit or debug) trying to run it would give me an error that adsk packages weren't found. It was a problem with fusion passing the environment to VS Code. Editing the settings .json for VS Code fixed it. 

0 Likes
Message 4 of 4

snitty
Explorer
Explorer

Huh. That did not solve the problem. Despite it seeming to be forcing Visual Studio to use the correct environment paths and version of Python (packaged with Fusion) I'm getting this error. 

 

Exception has occurred: ModuleNotFoundError
No module named 'adsk'
  File "/Users/snitkofb/Library/Application Support/Autodesk/webdeploy/production/88ce6bc1c34decd89efb26d037ca39bd2adac037/Autodesk Fusion 360.app/Contents/Libraries/Neutron/Python/Samples/SpurGear/SpurGear.py", line 9, in <module>
    import adsk.core, adsk.fusion, adsk.cam, traceback

 

Current plan is just to try this on my desktop…

0 Likes