Unable to access Drawing Sheets or select Drawing Views via API on macOS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm facing a critical issue while trying to develop a Python script for the Drawing environment on macOS. I am unable to access any DrawingView objects, either by selection or by iterating through the document object model.
Here is a summary of what has been tested directly in the "TEXT COMMANDS" console on an active Drawing document:
Accessing Sheets from Document fails:
# doc = app.activeDocument # print(doc) -> <adsk.drawing.DrawingDocument...> doc.sheets -> AttributeError: 'DrawingDocument' object has no attribute 'sheets' doc.activeSheet -> AttributeError: 'DrawingDocument' object has no attribute 'activeSheet'
Pre-selecting a View fails: When a single DrawingView is selected in the UI before running the script:
# selections = ui.activeSelections # selections.count -> 1 selected = selections.item(0) selected.entity -> Returns None
Interactive selection with ui.selectEntity fails: This method seems to be non-functional in the Drawing workspace, as it rejects every filter string I've tried.
# filter = "DrawingViews" -> RuntimeError: 3 : invalid argument filter # filter = "DrawingView" -> RuntimeError: 3 : invalid argument filter # filter = "" (empty string) -> RuntimeError: 3 : invalid argument filter
Given these results, it seems impossible to get a reference to a DrawingView to proceed.
This has been tested on Fusion 360 version 2602.1.14 on macOS 15.4.1.
Is this a known bug or limitation? Is there any alternative method to reliably get a user-selected DrawingView or even just the first DrawingView on the first sheet in this environment?
Thank you for your help.
(the ultimate goal is to generate a new type of table, similar to the Parts List table, but with specific informations and organization, attached to whatever "baseview" has been selected in Drawing mode)