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: 

F360 debugging doesn't work with latest VSC python version

26 REPLIES 26
SOLVED
Reply
Message 1 of 27
pludikar
954 Views, 26 Replies

F360 debugging doesn't work with latest VSC python version

Just so everyone knows - F360 debugging doesn't work with the last VSC python update (2020.10.332292344).  You need to revert back to v2020.9.114305 for F360 to open up VSC and for debugging to work again.

 

Peter

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
26 REPLIES 26
Message 2 of 27
MichaelT_123
in reply to: pludikar

Hi Mr Pludikar,

 

I am running ver.v2020.10.332292344, it seems without any problem.

 

Regards

MichaelT

MichaelT
Message 3 of 27
pludikar
in reply to: MichaelT_123

@MichaelT_123 

 

Hmm...  There is definitely an aberration - after clicking debug in the addIn dialog (tried different scripts and addIns), VSC would not startup (even after the Windows cmd.exe startup window appeared).  Restarting F360 did nothing, rebooting my PC did nothing.  The only thing that worked was to go back to the older python version. 

 

I just tried updating my Python version again to the latest - same issue as I reported.

 

Peter

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
Message 4 of 27
thomasa88
in reply to: pludikar

This happened to me some weeks ago.. come to think of it, I think it still is happening. I have just not used that computer in a while. So maybe not related to the latest update, but something else?

Message 5 of 27
pludikar
in reply to: thomasa88

I'd say it is 99.9% certain that it's an incompatibility between VSC python version and F360 - this was a common feature of VSC before they updated the API/debugger a month or so back.  Latest VSC Python version will not start up from F360 addIn dialog.  I had to open VSC as a stand alone, revert to the old version, shut F360 and VSC down and restart F360 

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
Message 6 of 27
MichaelT_123
in reply to: pludikar

Hi Mr Pludikar,

MS has put updated WinOS recently.

Make sure you are on the top of it than remove VSC python add-in and reinstall the latest version.

Regards

MichaelT

 

MichaelT
Message 7 of 27
pludikar
in reply to: MichaelT_123

So, my Windows did need updating - did that.  Also uninstalled VSC and forced F360 to reinstall it.  With latest version of Python, F360 will not start up VSC, but after reverting to previous version everything starts up as expected. 

 

Either I have a compatibility problem with latest Python/ F360 and something else on my PC, or more simply, a compatibility issue between F360 and VSC.  I still suspect the latter, but I wouldn't rule out the former if no-one else is having this issue.

 

Peter

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
Message 8 of 27
JeromeBriot
in reply to: pludikar

Hello,

 

Did you try to manually remove all the folders that start with "ms-python.python" in the preference folder of VS Code (i.e. C:\Users\<USENAME>\.vscode\extensions)?

 

Did you check that the version of Python used by VS Code is the one shipped with Fusion 360 (see at the bottom left of the VS Code UI)?

 

Message 9 of 27
pludikar
in reply to: JeromeBriot

@JeromeBriot 

 

Deleting the  "ms-python.python" files appears to have worked.  Thanks

 

Peter

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
Message 10 of 27
brad.bylls
in reply to: JeromeBriot

I also deleted the ms-python.python files.

When I run a debug on a script, VSC starts but then I get an error message.

bradbylls_0-1663267858445.png

It doesn't say what app won't run, and I don't see anything in the extensions that needs changing.

Brad Bylls
Message 11 of 27
pludikar
in reply to: brad.bylls

I'm not 100% sure if this is related, but debugging an add-in I'm working on is resulting in a complete F360 crash.  It was working fine until a few days ago.  If I single step through the code, assuming I've caught the breakpoint early enough, then everything seems to work fine.  However, if I run the code without any breakpoints F360 crashes after appearing to hang up for a minute or so.  F360 also seems to hang for a minute when debugging is invoked for the first time.

 

I've not submitted a crash report yet, because I'm still trying to figure out if it's my code (which is a distinct possibility),  or if it's a new release of f360, or VSC.  I'm on a pre-release insider version, which does add a complication too.

 

Peter

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
Message 12 of 27
MichaelT_123
in reply to: pludikar

Hi Mr Pludicar,

 

It is hard to make a judgement about the hard crash.

Regarding "F360 also seems to hang for a minute when debugging is invoked for the first time" consider add to launch.json the statement: 

"justMyCode": true,
It will instruct VSCode to create debug table only for your specific code and not external to it modules (whole F360 construct and some in this case).
 
Regards
MichaelT
 

 

MichaelT
Message 13 of 27
pludikar
in reply to: MichaelT_123

I did think that it may be a corruption of the cache, but I’m now pretty certain that the crash has nothing to do with my code. I can run my code without debugging and invoking VSC, but then I’m blind and progressing my code is very hard. I also moved f360 from my desktop to my laptop, which involved updating f360 as my laptop version was almost a year out of date. Same crash resulted.

The delay in starting up is a new phenomenon, it wasn’t happening until a few days ago. Unfortunately I can’t correlate the startup delay and crashing with any particular f360 update. Nevertheless I will try setting “justMyCode: True” and see if that changes anything.

Peter
I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
Message 14 of 27
brad.bylls
in reply to: pludikar

Hi @pludikar ,

 

When I try to debug a script, it goes to VSC but then does nothing.

I even added a breakpoint but still nothing, no debugging happening.

 

Brad

Brad Bylls
Message 15 of 27
pludikar
in reply to: brad.bylls

Hi @brad.bylls

 

Is this something that has just started to happen?  We're you able to add breakpoints etc. previously?  Does this happen on one of the example Add-ins?

 

Peter

 

 

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
Message 16 of 27
brad.bylls
in reply to: pludikar

Hi @pludikar,

 

Yes, I used to be able to do debugging on my code, with breakpoints.

It seems that several people have had this trouble since the September upgrade.

I have tried it on the Spur Gear example and get the same results.

 

Brad

Brad Bylls
Message 17 of 27
pludikar
in reply to: brad.bylls

Hi @brad.bylls 

 

Just to let you know - I got similar results as you did using the Spur Gear example.  I was, however, able to get a breakpoint to work in the add-in "run" method, but thereafter it went haywire. 

 

Clicking the restart button on the VSC debug panel resulted in the buttons disappearing, and attempting to start another debugging session in VSC results in the warning that debugging is already underway.

 

Stopping the Add-in from F360 and restarting debugging also results in a similar message.  F360 then went into it's "I'm waiting for software to happen" mode (black left panel), and after a minute or so F360 gave up and died.

 

This looks like an inherent F360 bug! 

 

Peter

 

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
Message 18 of 27
brad.bylls
in reply to: pludikar

Now it's just wait and see what Autodesk does to fix it.

Brad Bylls
Message 19 of 27
pludikar
in reply to: brad.bylls

Hi @brad.bylls,

 

Are you still experiencing issues with VSC.  I certainly am. 

 

I've been able to establish that there's an issue, probably a memory leak, that causes the VSC/F360 combination to misbehave, and... I've been able to get AD to recreate and recognize the problem.  It seems that if you leave VSC/F360 hanging in debug mode for some time, eg for an hour or so, then it results in a crash once you start to use it again.. 

 

However, it also appears that once F360 crashes, it leaves some persistent memory of that crash, and it crashes constantly thereafter.  There's no obvious way of cleaning out the memory, that I can determine (maybe someone can help).  I've tried rebooting my PC, reinstalling F360, repairing F360, deleting ms-python.python files in VSC environment folder.

 

I'm now in a situation where I can't do anything with VSC.  F360 even crashes if I hover the mouse over a variable in order to inspect the contents.  The issue has got worse with time, and for the moment F360/VSC is totally unusable.  Are you having the same problems?

 

Peter

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
Message 20 of 27
brad.bylls
in reply to: pludikar

@pludikar 

My only problem is VSC doesn't work when I try to debug some code.

Haven't run into any other problems like you.

 

Brad

Brad Bylls

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report