Extract shell thickness through scripting

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
100 Answers 500 Comments 250 Likes First Anniversary
✭✭✭✭
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: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    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