How can I know the number of nodes and elements on a face?

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 859
500 Comments Photogenic Name Dropper Solution Developer Community of Practice Member
✭✭✭✭
edited June 2023 in Structures

How can I know the number of nodes and elements on a face that is selected in the UI?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 859
    500 Comments Photogenic Name Dropper Solution Developer Community of Practice Member
    ✭✭✭✭
    Answer ✓

    One can use:

    faceId = ExtAPI.SelectionManager.CurrentSelection.Ids[0] # Id of selected face in the UI
    meshData = ExtAPI.DataModel.Project.Model.Analyses[0].MeshData # reference meshData
    faceMesh = meshData.MeshRegionById(faceId) # get mesh data for face
    faceMesh.ElementCount # get number of elements on face
    faceMesh.NodeCount # get number of nodes