Is it possible to obtain the faceId to which a certain element belongs?
Please clarify your question: what tool are you using ? Mechanical, MAPDL, PyMechanical, PyMAPDL?
It's Mechanical.
This should help: https://discuss.ansys.com/discussion/comment/3689#Comment_3689?utm_source=community-search&utm_medium=organic-search&utm_term=MeshData You would have to adapt it to get the face in geobody, instead of the entire body, but the principle stays the same.
Dear Pernelle Marone-Hitz I tried it using the method I was taught, but it didn't work out. If possible, please provide specific instructions.
The only thing to add from the previous script is to loop on the faces of the geobody.
element_id = 25 mesh_data = ExtAPI.DataModel.Project.Model.Analyses[0].MeshData bodies = ExtAPI.DataModel.Project.Model.Geometry.GetChildren(DataModelObjectCategory.Body, True) for body in bodies: geobody = body.GetGeoBody() for face in geobody.Faces: mesh_for_face = mesh_data.MeshRegionById(face.Id) if element_id in mesh_for_face.ElementIds: print('Element ' + str(element_id) + ' is in face : ' + str(face.Id))
Dear Pernelle Marone-Hitz Thank you for teaching me. It was very helpful!