- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to get into python scripting. I have created and ran the mandatory "Hello there" script. It runs fine from Fusion. When I try to run it from Visual Studio Code I get an error.
I have read through here and found this to appear to be a fairly common problem. Unfortunately all the answers deal with going to another thread on the forum, leading to another thread on the forum and so on and so fourth. It all ends up looking Greek (so to speak). Any help will be greatly appreciated.
Here is the code:
#Author-
#Description-
import adsk.core, adsk.fusion, adsk.cam, traceback
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
ui.messageBox(" This a a test")
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
When I run it I get the following error:
Exception has occurred: ModuleNotFoundError
No module named 'adsk'
File "/Users/bradbumgarner/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/TestScript/TestScript.py", line 4, in <module>
import adsk.core, adsk.fusion, adsk.cam, traceback
ModuleNotFoundError: No module named 'adsk'
My app and system specs:
Fusion 360 2.0.15299 x86_64 [Native]
Active Plan: Personal
macOS 12.6.3 (21G419) on MacBookAir7,2
My Visual Studio Code specs:
Version: 1.75.1 (Universal)
Commit: 441438abd1ac652551dbe4d408dfcec8a499b8bf
Date: 2023-02-08T21:34:59.000Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Darwin x64 21.6.0
Sandboxed: No
Solved! Go to Solution.