Hi,
I just successfully set up debugging with VS Code, and I wanted to share my Fusion 360 Python script to enable remote debugging with the latest version of VS Code (1.30.1) & Python (2018.12.1) in Windows.
Here is the script, which hopefully be maintenance free for the future version of the extension:
# Run this from Fusion 360's Text Command panel each time starting Fusion 360
import os
from os import path
vscodeDir = "C:\\Users\\tikum\\.vscode\\extensions"
vscodeExtDir = ""
# with os.scandir(vscodeDir) as it:
# for entry in it:
for entry in os.scandir(vscodeDir):
if entry.name.startswith('ms-python.python') and entry.is_dir():
vscodeExtDir = entry.path
import sys
sys.path.append(vscodeExtDir + "\\pythonFiles\\lib\\python")
import ptvsd
ptvsd.enable_attach(("0.0.0.0", 3000))
2 discrepancies in the extension versions that Marshal's and my code was written for:
* The location of ptvsd module has been moved from pythonFiles/PythonTools to pythonFile/lib/python within the extension folder
* ptvsd.enable_attach no longer takes "my_secret" argument
I have saved this script as a new custom script in Fusion 360 and run it every time I startup Fusion 360, making it a 3-click process.
Also, REMOVE this line from VS Code's launch.json file:
"secret": "my_secret",
Hope this helps somebody,
Kesh