How to get node id from a vertex id in Mechanical via scripting?

Rohith Patchigolla
Rohith Patchigolla Member, Moderator, Employee Posts: 206
100 Comments 25 Answers Second Anniversary 25 Likes
✭✭✭✭

How to get node id from a vertex id in Mechanical via scripting?

Best Answer

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 206
    100 Comments 25 Answers Second Anniversary 25 Likes
    ✭✭✭✭
    Answer ✓

    Let's say if the vertex Id is 83 (which can be found from scoping of a load or a bc .. loadObj.Location), then one can get the corresponding node ID/s (if the scoping is face/edge for example) using the below script.

    Mesh = ExtAPI.DataModel.MeshDataByName("Global")
    mR = Mesh.MeshRegionById(83)
    nodeIds = mR.NodeIds