As I wrote about it in this blog post, we were switching to Visual Studio Code as the debugging tool for Fusion 360 - I think that's great 😀
At the same time, we also upgraded the Python version used in Fusion 360 to 3.7.3
Unfortunately, some add-ins got caught up in that. It looks like the new Python version is more strict and so you might run into compiler issues.
Please do check your add-ins to make sure they are still working ok. Thank you!
Debugging to the rescue!
First of all, you need to install Visual Studio Code. If you follow the below steps and you do not have it installed yet, then you will get a notification dialog asking you to do this along with the URL to the download site - but of course, you can easily find it on the net, and I'm providing the link as well in the paragraph 🙂
1) Select your add-in in the "Scripts and Add-Ins" dialog and select "Debug" under the "Run" drop-down menu
2) As soon as Visual Studio Code starts up, switch over to it (in case it does not get focus automatically), select the "Debug" environment and click the "Start Debugging" button (looks like a Play button)
3) As shown in the above picture, it's a good idea to select the "Raised Exceptions" option in the "Breakpoints" section. This way you'll get a meaningful error even if the compiler runs into problems with a module you're trying to load. This won't help though if the problem is in our main module - this blog post has a workaround for that.
4) Now you have the usual options for stepping through the code, use breakpoints, etc
5) If you want to start the process again (maybe your code failed, etc) and the debugging toolbar in Visual Studio Code is still visible, then click the "Disconnect" button on it, and follow the above steps again
6) Using print() you can write information to the "Debug Console":
More information on debugging in VS Code on its website: https://code.visualstudio.com/docs/editor/debugging
-Adam