Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to access the material of a component that has both subcomponents with different materials and its own bodies, but I'm getting errors that there is no material attribute associated with it. there's a picture of my structure at the bottom, Z Idler A is the component I'm trying to access the material of. This is my code:
root = design.rootComponent
occs = root.allOccurrences
# Gather information about each unique component
componentsToExport = []
for occ in occs:
comp = occ.component
if not hasattr(comp, 'material'): continue
if not hasattr(comp.material, 'name'): continue
if comp.material.name != 'ABS Plastic': continue
Solved! Go to Solution.