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: 

Visual Studio not launching when selecting edit add-ins

36 REPLIES 36
SOLVED
Reply
Message 1 of 37
paul.slaterMZZFE
2055 Views, 36 Replies

Visual Studio not launching when selecting edit add-ins

Visual Studio Code will not run when edit is selected. this has become a problem since a Fusion update.

 

would someone be kind enough to help please?

 

thanks Paul.

36 REPLIES 36
Message 2 of 37
goyals
in reply to: paul.slaterMZZFE

May be you can try deleting ms python extensions folder, start with name ms-python.python-xxx, from the following location and retry the edit/debug workflow from Fusion. Doing this will re-install the extension at the same location. Let us see if this resolves the problem. 

 

Mac: /Users/<user name>/.vscode/extensions/

Windows: C:/Users/<user name>/.vscode



Shyam Goyal
Sr. Software Dev. Manager
Message 3 of 37
paul.slaterMZZFE
in reply to: goyals

I have renamed the extensions folder and re started Fusion and it said that extension being loaded but after that it did not launch Fusion.
Regards Paul.
Message 4 of 37

Sorry, did not launch VS Code.
Message 5 of 37

Hi @paul.slaterMZZFE ,
As kindly suggested by @goyals please find detailed steps to clear vscode extesions.

Please do following steps.

  1. Close Fusion 360
  2. Uninstall python extensions from vs code
  3. Close vs code
  4. Go to '%homepath%\.vscode\extensions' or for mac  '~/.vscode/extensions' 
  5. Clear any ms-python extension directories like ms-python.python-20##.###
  6. Delete ".obsolete" file
  7. Start fusion
  8. Go to addins and debug or edit any sample add-in script.
  9. You should able to debug it successfully.

PLease lets us know if you need further help
 


Nilesh Mohite
LinkedIn

If my answer helped you, please use  ACCEPT SOLUTION .
Also be generous with Likes!  Thank you and enjoy!

Message 6 of 37

I have tried what you have advised but still exactly the same.
Regards Paul.

[cid:image001.png@01D6FA3F.F306EF90]
Message 7 of 37
goyals
in reply to: paul.slaterMZZFE

I am not able to reproduce the problem on my side. Can you please share fusion log files from your machine? It might give us some clue to understand the problem better. Please take a look at this post explaining how you can collect fusion log files manually on your machine. https://knowledge.autodesk.com/support/fusion-360/learn-explore/caas/sfdcarticles/sfdcarticles/How-t... . Thanks.



Shyam Goyal
Sr. Software Dev. Manager
Message 8 of 37
paul.slaterMZZFE
in reply to: goyals

Nilesh -I have attached the file as requested. I also have another PC that I use and it has Fusion 360 and it behaves exactly the same.
Thank you and kind regards Paul
Message 9 of 37

Can you reattach the file? First attachment is missing.

Nilesh Mohite
LinkedIn

If my answer helped you, please use  ACCEPT SOLUTION .
Also be generous with Likes!  Thank you and enjoy!

Message 10 of 37

Nilesh -please find attached. Regards Paul.

Message 11 of 37

I recently had the same problem and was able to fix it by exiting Fusion and use Task Manager to make sure there isn't a Fusion process running in the background,  delete the entire .vscode folder, and restart Fusion.  Hopefully, that works for you.

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

Brian -thank you for your advice. I have just tried that and it still does not work.

I am not sure if you picked up that I have it on both my pc’s exactly the same?

Also do you see the CMD window with some buffer issues? please see attached file.

 

kind regards Paul.

Message 13 of 37

I did see the command window and I believe I had the same buffer warnings.  I believe that is just a warning about a function being used that's been deprecated.

 

Does VS Code start for you from the Start Menu?  You still need it to start from Fusion to be able to debug, but that would at least tell you that VS Code is installed and working and the problem is probably on the Fusion side?

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

Brian yes VSCode does start from the windows prompt. Hope that helps. Regards Paul.
Message 15 of 37

Hi @paul.slaterMZZFE
Thanks for logs.
We will go through the same.
I could able to see the same screen. I just hit Enter on that screen and it went ahead and installed the extension. You can try this.

Screenshot 2021-02-04 at 12.39.36 AM.png

But if that doesn't work for you then meanwhile can you try following workaround.
Repeate the earlier process up to the 6th point 

  1. Close Fusion 360
  2. Uninstall python extensions from vs code
  3. Close vs code
  4. Go to '%homepath%\.vscode\extensions' or for mac  '~/.vscode/extensions' 
  5. Clear any ms-python extension directories like ms-python.python-20##.###
  6. Delete ".obsolete" file
    (At this point if want to clear any remaining fusion process on safer side, you can try restarting machine if possible)
  7. Now open the VScode separately
  8. Go to extesions
  9. Search ms-python in search bar
  10. Install Python extension
  11. After successful installation you can close vs code
  12. Now start fusion and try to edit or debug script
    let me know if this works for you.

     

    Installing extesion manually.png

Nilesh Mohite
LinkedIn

If my answer helped you, please use  ACCEPT SOLUTION .
Also be generous with Likes!  Thank you and enjoy!

Message 16 of 37

Nilesh I will try in the morning and let you know. Regards Paul
Message 17 of 37
goyals
in reply to: paul.slaterMZZFE

By looking at the logs it seems like Fusion is not able to open the port on which VSCode can communicates with it. Can you try the below script in text command window after switching to python mode? Here is a blog explaining the steps how to switch to python mode in text command window in Fusion.  https://modthemachine.typepad.com/my_weblog/2020/01/run-commands-from-the-text-commands-panel.html

 

import debugpy

debugpy.listen('127.0.0.1',9000) #9000 is default port number which Fusion use to communicate with VSCode.

Are you seeing any error while executing this script on Fusion side?

 



Shyam Goyal
Sr. Software Dev. Manager
Message 18 of 37

Goyals -thank you for your advice. This is the result that I got
import debugpy
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'debugpy'


debugpy.listen('127.0.0.1',9000)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'debugpy' is not defined
Thanks Paul.
Message 19 of 37
goyals
in reply to: paul.slaterMZZFE

This error indicates possibly two things:

1. Extension is not installed properly on your machine. I am having 2021.1.502429796 version on my machine and it does have debugpy module so probably you can check how is the status on your side. 

2. We assumed that extension is installed at the following location and add the path of debugPy module in python system path from this location. So another possible reason is extension installed at different path other than below path for you.

Windows: '%USERPROFILE%\.vscode\extensions'

Mac:~/.vscode/extensions

 

As a workaround you can try adding the path of debugPy module in to Fusion python interpreter system path and see if it resolve problem for you or you can keep the extensions at the above path.


I hope it helps. Thanks.



Shyam Goyal
Sr. Software Dev. Manager
Message 20 of 37
paul.slaterMZZFE
in reply to: goyals

Goyals -this is a copy of the path for the extensions:

C:\Users\Admin\.vscode\extensions

I am not sure how to add the path for the debugpy.

Is it possible that someone could just log on and sort this for me please? I can confirm that I am a maintenance subscriber.

Thank you. Paul.

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