Nodal named selection: retrieve node numbers in selection?

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 870
100 Answers 500 Comments 250 Likes First Anniversary
✭✭✭✭
edited June 2023 in Structures

How can I know the node numbers of a nodal named selection, through scripting?

Tagged:

Best Answer

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 870
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    Answer ✓

    If "my_NS" refers to the named selection:

    my_NS.Location.Ids
    

    will return a list of the Ids of the entities scoped in the Named Selection. For a nodal named selection, these "ACT ids" are equal to the "APDL/mesh ids".

Answers

  • tf90
    tf90 Member Posts: 3
    First Comment
    **

    Hi! I need your help. Why my named selection is empty? I created several named selections in Workbench. And I try to read the 'file.rst' to obtain the named selections to do further calculations. But it prints nothing. It seems that the named selections are not stored in the 'file.rst' file. Please help me! Thank you very much! The following is the code snippet.

    file = 'file.rst'

    model = dpf.Model(file)

    print(model.metadata.available_named_selections)

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 870
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭

    Hi @tf90 , please open a separate post for this, as this initial post is about Mechanical automation API and on your side the issue is related to Mechanical DPF.