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

Options
Chemsdine CHEMAI
Chemsdine CHEMAI Member, Employee Posts: 201
First Anniversary Ansys Employee Solution Developer Community of Practice Member 5 Likes
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
    First Anniversary Ansys Employee Solution Developer Community of Practice Member 5 Likes
    Answer ✓
    Options

    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)