Traverse Assembly And Output BOM File Including Attributes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody help???
I have the following Python code to set several different attributes in a Fusion 360 part document.....
def SetPartType(PartType):
app = adsk.core.Application.get()
selectedComponent = adsk.fusion.Design.cast(app.activeProduct).rootComponent
compAttributes = selectedComponent.attributes
newAttribute = compAttributes.add('PartAttributes', 'Part: Type', PartType)
In this case, for example, I can set the "Part: Type" attribute to "Laser Cut Profile".
I can read a parts attributes using the following Python code....
def GetPartType():
app = adsk.core.Application.get()
selectedComponent = adsk.fusion.Design.cast(app.activeProduct).rootComponent
compAttributes = selectedComponent.attributes
readAttribute = compAttributes.itemByName('PartAttributes', 'Part: Type')
PartType = readAttribute.value
return PartType
Does anybody know how to traverse through an assembly and export the parts list to a (ascii) text file that includes the part attribute (in this case Laser Cut Profile.
I need to export, for each part, the following information....
Part: Number
Part: Description
Part: Quantity
Part: Attribute
For example,
Part Number: 0001
Part Description: Bearing Housing
Part Quantity: 12
Part Type: Laser Cut Profile
Many thanks in advance!!!
Darren