Extract information on beams

Member, Moderator, Employee Posts: 873
100 Answers 500 Comments 250 Likes Second Anniversary
✭✭✭✭
edited June 2023 in Structures

How can I extract beam properties through scripting?

Tagged:

Answers

  • Member, Moderator, Employee Posts: 873
    100 Answers 500 Comments 250 Likes Second Anniversary
    ✭✭✭✭
    Answer ✓

    The following function can be used:

    1. def ExtractBeamData():
    2. '''
    3. Extract information on beams
    4. '''
    5. listExportBeamData = []
    6. for part in ExtAPI.DataModel.Project.Model.Geometry.Children:
    7. for body in part.Children:
    8. if body.Suppressed is False:
    9. geoBody = body.GetGeoBody()
    10. if geoBody.BodyType.ToString() == "GeoBodyWire":
    11. name = body.Name
    12. section = geoBody.CrossSection.Name.ToString()
    13. lengthValue = round(body.Length.Value, 5)
    14. lengthUnit = body.Length.Unit
    15. length = str(lengthValue) + str(lengthUnit)
    16. sectionValue = round(body.CrossSectionArea.Value, 5)
    17. sectionUnit = body.CrossSectionArea.Unit
    18. sectionArea = str(sectionValue) + str(sectionUnit)
    19. listExportBeamData.append(
    20. [name, section, length, sectionArea])
    21. return listExportBeamData

Welcome!

It looks like you're new here. Sign in or register to get started.