Extract information on beams

Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 873
✭✭✭✭
Answers
-
The following function can be used:
- def ExtractBeamData():
- '''
- Extract information on beams
- '''
- listExportBeamData = []
- 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() == "GeoBodyWire":
- name = body.Name
- section = geoBody.CrossSection.Name.ToString()
- lengthValue = round(body.Length.Value, 5)
- lengthUnit = body.Length.Unit
- length = str(lengthValue) + str(lengthUnit)
- sectionValue = round(body.CrossSectionArea.Value, 5)
- sectionUnit = body.CrossSectionArea.Unit
- sectionArea = str(sectionValue) + str(sectionUnit)
- listExportBeamData.append(
- [name, section, length, sectionArea])
- return listExportBeamData
4