Message 1 of 1
Fusion 360 Python Script - Get The Drawings Root Component (Assembly or Part)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody help?
I need to know, using a Fusion 360 Python script, if a detail drawing contains an assembly or a part.
I have the following code....
if isinstance(doc,adsk.drawing.DrawingDocument):
ui.messageBox("DRAWING IS OPENED", 'Fusion 360', 0, 3)
#doc = app.activeProduct
rootComp = doc.rootComponent
allOccurrences = rootComponent.allOccurrences
DocumentType = 'D'
if allOccurrences.count > 0:
DocumentType = 'A'
ui.messageBox(DocumentType, 'Fusion 360', 0, 3)
return
Can anybody tell me if the code is correct?
If not, please can you update it?
Many thanks in advance!
Darren