pogoGo
Mechanical
- Jul 24, 2015
- 16
I'm trying to extract the material assigned to a particular element (i.e. label # 100). It seems like a very simple command:
elementMaterial = odb.rootAssembly.instances['Part-1'].elements[99].sectionCategory.name
This works flawlessly when the instance has a single section assignment. However, when the instance has two section assignments (i.e. a part with weld overlay), the "section category name" extracted is incorrect (it grabs the other section's material). There are more ways to get to ".elements[#].sectionCategory.name" but they all yield the same result.
In this example, Section-1's elements are from 1 - 75 and Section-2's elements are from 76 - 125 so I can't see how it is grabbing the Section-1 material. The only thing i can think of is that there is a distinct difference between a material and a section category.
Is there a better way to get the material used by an element?
elementMaterial = odb.rootAssembly.instances['Part-1'].elements[99].sectionCategory.name
This works flawlessly when the instance has a single section assignment. However, when the instance has two section assignments (i.e. a part with weld overlay), the "section category name" extracted is incorrect (it grabs the other section's material). There are more ways to get to ".elements[#].sectionCategory.name" but they all yield the same result.
In this example, Section-1's elements are from 1 - 75 and Section-2's elements are from 76 - 125 so I can't see how it is grabbing the Section-1 material. The only thing i can think of is that there is a distinct difference between a material and a section category.
Is there a better way to get the material used by an element?