sectionCategory vs Material
sectionCategory vs Material
(OP)
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?





RE: sectionCategory vs Material
You can access the section assignments and get the regions (elements) used for them:
print session.odbs['Job-1.odb'].rootAssembly.instances['PART-1-1'].sectionAssignments[0].region.elements
In this case the 0 indicates the first section assignment and you can check if there are other.
You can check all existing section in the odb with these and ongoing commands:
print session.odbs['Job-1.odb'].sections
print session.odbs['Job-1.odb'].sectionCategories
RE: sectionCategory vs Material
print session.odbs['Job-1.odb'].rootAssembly.instances['PART-1-1'].sectionAssignments[0].region.elements[0].sectionCategory
print session.odbs['Job-1.odb'].rootAssembly.instances['PART-1-1'].sectionAssignments[1].region.elements[0].sectionCategory
it shows the same section category name for both sections. However, the CAE assembly/part and ODB show two different material names in the color coding.
I made the file in 6.11 and have been using it as a template. Could it just be something that got messed up in the conversion to 6.13?
RE: sectionCategory vs Material
print session.odbs['Job-1.odb'].sectionCategories
I've attached this simple block in case anyone wants to figure out what I'm doing wrong.
RE: sectionCategory vs Material
CODE -->
You are correct, the output is wrong. It always shows only the first section with the first material.
I had a look into the support database and found an old service request of a colleague. It seems that the 'wrong' behavior is made on purpose to reduce the size of the odb. Identical section categories are merged automatically to one when storing this information in the odb, even when the material within is different.
It is possible to deactivate that behavior with an environment setting in the abaqus_v6.env.
CODE -->
RE: sectionCategory vs Material