What are the methods to retrieve geo bodies and tree bodies?

Chemsdine CHEMAI
Chemsdine CHEMAI Member, Employee Posts: 201
100 Likes 100 Comments Second Anniversary Ansys Employee
✭✭✭✭
edited February 15 in Structures

What are the methods to retrieve geo bodies and tree bodies?

Tagged:

Answers

  • Chemsdine CHEMAI
    Chemsdine CHEMAI Member, Employee Posts: 201
    100 Likes 100 Comments Second Anniversary Ansys Employee
    ✭✭✭✭
    Answer ✓

    To retrieve geo bodies, one can use the GeoData:

    myIds = ExtAPI.SelectionManager.CurrentSelection.Ids
    geoBody = ExtAPI.DataModel.GeoData.GeoEntityById(myIds[0])
    

    To retrieve tree bodies, one can either use the automation API :

    treebody=ExtAPI.DataModel.Project.Model.Geometry.Children[0].Children[0]
    

    or pass from the geobody to the treebody using :

    treebody=ExtAPI.DataModel.Project.Model.Geometry.GetBody(geobody)