How to retrieve Beam element cross section properties?

Options
Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 414
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited June 2023 in Structures

How to retrieve Beam element cross section properties?

Tagged:

Best Answer

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 414
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    Answer ✓
    Options

    Get the body associated with the element and then the properties of the cross-section assigned to the Geo. Body

    body = element.GetBody()
    my_cs = filter(lambda x: (body.CrossSection.Name == x.Name), ExtAPI.DataModel.GetObjectsByType(Ansys.ACT.Automation.Mechanical.CrossSections)[0].Children)[0]
    # Cross-section area
    area = my_cs.PropertyByName("CrossSectionArea").StringValue
    
    # Polar moment of inertia Iyy
    iyy = my_cs.PropertyByName("CrossSectionIYY").StringValue
    
    # Polar moment of inertia Izz
    izz = my_cs.PropertyByName("CrossSectionIZZ").StringValue
    

Answers