Unable to access Drawing Sheets or select Drawing Views via API on macOS

Unable to access Drawing Sheets or select Drawing Views via API on macOS

sbarichjadato
Community Visitor Community Visitor
141 Views
1 Reply
Message 1 of 2

Unable to access Drawing Sheets or select Drawing Views via API on macOS

sbarichjadato
Community Visitor
Community Visitor

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:

  1. 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'
    
  2. 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
    
  3. 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)

0 Likes
142 Views
1 Reply
Reply (1)
Message 2 of 2

boopathi.sivakumar
Autodesk
Autodesk

Fusion API does have limitation with the drawing workspace we can 

Currently drawing supports very few here is the sample

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-8FBCCDA0-E2F8-4A8C-B748-E998284C48B0

 


Boopathi Sivakumar
Senior Technology Consultant

0 Likes