Mechanical scripting: nodes associated with a named selection?

Erik Kostson
Erik Kostson Member, Employee Posts: 202
50 Answers 100 Comments Photogenic 5 Likes
✭✭✭✭
edited June 2023 in Structures

Using mechanical scripting in python, how can I access the nodes associated with a named selection?

Tagged:

Best Answer

  • Erik Kostson
    Erik Kostson Member, Employee Posts: 202
    50 Answers 100 Comments Photogenic 5 Likes
    ✭✭✭✭
    Answer ✓

    Below is a script that does this:

    ns=model.NamedSelections.Children
    f=ns[0].Location.Ids
    meshData = ExtAPI.DataModel.Project.Model.Analyses[0].MeshData
    faceMesh = meshData.MeshRegionById(f[0])
    nodes=faceMesh.NodeIds