Fusion 360 Python Script - Get Part Material when Exporting A Bill Of Materials

Fusion 360 Python Script - Get Part Material when Exporting A Bill Of Materials

isocam
Collaborator Collaborator
368 Views
1 Reply
Message 1 of 2

Fusion 360 Python Script - Get Part Material when Exporting A Bill Of Materials

isocam
Collaborator
Collaborator

Can anybody help?

 

I am using a Python script to export a "bill of materials" from a Fusion 360 Assembly.

 

Here is part of my code so far....

 

for i in range(0, occurrences.count):

    occ: adsk.fusion.Occurrence = occurrences.item(i)

 

    PartNumber = re.split(' v\d+', occ.name)[0]

 

    PartDescription = occ.component.description

 

    PartMaterial - occ.component.????????

 

 

All I need to know s how to get a parts material property, highlighted in red.

 

For example, steel, rubber, plastic etc

 

Many thanks in advance!

 

Kindest Regards

 

Darren

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

BrianEkins
Mentor
Mentor

This should do it.

PartMaterial = occ.component.material.name
---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com