What's the difference between "Tree geometry" and "Geodata" in Mechanical API?

Options
Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 813
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
edited June 2023 in Structures

See above.

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 813
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Options

    One important thing to understand with geometry in Mechanical : there are two sorts of "geometry" with different sets of IDs:

    • The bodies in the Mechanical tree have their own ID, as objects of the Mechanical tree, pretty much like a fixed support boundary condition, or any other object in the tree, will have an ID. These objects are grabbed by ExtAPI.DataModel.Project.Model.Geometry.Children
    • The "real" geometry (the one that is plotted, which you can zoom, rotate, pan, select bodies, faces, edges on etc) also have their sets of ids (there are IDs for bodies, faces, edges, vertices, etc). These objects are grabbed by ExtAPI.DataModel.GeoData

    There are ways to get the IDs of the geodata geometry from the tree geometry and the other way around:

    my_tree_body = ExtAPI.DataModel.Project.Model.Geometry.GetBody(my_geobody)
    my_geo_body = my_tree_body.GetGeoBody()