Extract shell thickness through scripting

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 715
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
edited June 2023 in Structures

How can I extract shell thickness for each shell in a Mechanical model?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 715
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓

    The following function can be used:

    def ExtractShellThickness():
        '''
        Extract thickness values for shell bodies
        '''
        listExtractShellThickness = []  
        for part in ExtAPI.DataModel.Project.Model.Geometry.Children:
            for body in part.Children:
                if body.Suppressed is False:
                    geoBody = body.GetGeoBody()
                    if geoBody.BodyType.ToString() == "GeoBodySheet":
                        name = body.Name.ToString()
                        thicknessValue = round(body.Thickness.Value, 5)
                        thicknessUnit = body.Thickness.Unit
                        listExtractShellThickness.append([
                            str(name),
                            str(thicknessValue) + str(thicknessUnit)
                        ])
        return listExtractShellThickness