Can't edit or debug my python scripts

Can't edit or debug my python scripts

erik_per_rosen
Observer Observer
2,152 Views
7 Replies
Message 1 of 8

Can't edit or debug my python scripts

erik_per_rosen
Observer
Observer

So I wanted to start playing around with python scripts inside of Fusion but it seems like I can't even manage to open them from Fusion. 

Pressing the edit/debug does absolutely nothing. I read a couple of thread's absolut downgrading a python extension in Vs code but it did not work for me.

I also tried to do a new clean install of everything but it still doesn't seem to work for me. 

Would love to know your thoughts about what the issue might be.

Thank you so much in advance,

Erik

0 Likes
Accepted solutions (1)
2,153 Views
7 Replies
Replies (7)
Message 2 of 8

BrianEkins
Mentor
Mentor
Accepted solution

It looks like VS Code changed in this last update, which has broken how Fusion interacts with it. 

 

The most recent release of Visual Studio Code (1.89.0) has changed how it supports Python, and this change has broken how Fusion sets up and connects to Python. This results in not being able to open VS Code from the Scripts and Add-Ins dialog, which means you can’t debug your scripts and add-ins. In case you’re interested, here is the breaking VS Code change: https://github.com/microsoft/vscode-python/pull/23211

 

I've learned that this change was a surprise, and Autodesk is working on a fix., but until that can be delivered, you can patch it on your side. To do that, extract pre-run.py from the attached zip file and copy it to the following location. (It won't allow me to attach a py file.) This will overwrite your existing pre-run.py file.

 

Windows
 %appdata% \Autodesk\Autodesk Fusion 360\API\Python\vscode

 

Mac
 ~/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Python/vscode

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 8

erik_per_rosen
Observer
Observer
Thank you so much for the fast response even if i asked the question on a weekend.
This fix worked like a charm! 
0 Likes
Message 4 of 8

YouElz
Contributor
Contributor

Thank you @BrianEkins this worked for me as well. 

0 Likes
Message 5 of 8

JeromeBriot
Mentor
Mentor

The lastest release (2.0.19204) seems to fix this issue, at least on Windows.

Message 6 of 8

k_vermeulenL82UR
Explorer
Explorer

Hello, i am currently experiencing this issue however, the pre-run.py file does not seem to work anymore. I tried a clean install and downgrading VS code. I am using a trial version to test. If this test is succesful i can apply for a licence. However, when i just installed the program I could edit the scripts, so something has broken it. 

0 Likes
Message 7 of 8

k_vermeulenL82UR
Explorer
Explorer

I tried clean installing again, however, that still does not seem to work. Anyone else experiencing this issue?

0 Likes
Message 8 of 8

dominik_zarczynski
Autodesk
Autodesk

Just to document the solution for other users. Selecting other (unused) debugging port solved the issue:

dominik_zarczynski_0-1747916204756.png

 

If my answer helped you, please click Accept Solution. Thanks!

Dominik Żarczyński
Customer Technical Success

My Screencasts | Fusion 360 Webinars | Tips and Best Practices | Troubleshooting

0 Likes