Hi,
I'm trying to add a centermarks to a grid of about ~300 holes in a drawing. There doesn't seem to be a way to do this without clicking on every single hole individually (although I'd love to be proven wrong), so of course, I thought it would be a good idea to write a script to do it. Unfortunately there is no documentation on using python inside the drawing mode of fusion 360 (as far as I can see), and I quickly came across a showstopper bug. To replicate:
Create a model with any body (even a cube will do), then create a drawing from it and place the model in the drawing. Then go to the scripting area and run the following python:
import adsk.core app = adsk.core.Application.get() print(app.activeDocument.products.count()) # should print out '1' prod = app.activeDocument.products.item(0) # raises exception: # Traceback (most recent call last): # File "<string>", line 1, in <module> # File "/Users/jeremy/Library/Application Support/Autodesk/webdeploy/production/11badf998e664af8a6c8e3ef3d0a55f18ae8cb3c/Autodesk Fusion 360.app/Contents/Api/Python/packages/adsk/core.py", line 9509, in item # return _core.Products_item(self, *args) # RuntimeError: 2 : InternalValidationError : res prod = app.activeDocument.products[0] # doesn't raise an exception, but... print(type(prod)) # prints: '<class 'NoneType'>', which means that something bad happened
Is there any information on how to use scripting within the drawing view of fusion 360 ?
Thanks,
Jeremy
Solved! Go to Solution.
Solved by ekinsb. Go to Solution.
Not sure if this should be in a reply or in a separate thread, but I would also really love to see a drawing API for Fusion 360 (for me, specifically, I want to be able to create custom tables and auto populate them with plugin information). Any way to push this up the priority list?
--
Jesse Rosalia
Founder, Bommer
The best thing would be to create a request in the Idea Station. That's what will be the most visible to the product managers that decide the priorities and what work will get done.