How to export node coordinate locations from a Named Selection

Mike.Thompson
Mike.Thompson Member, Employee Posts: 367
25 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
edited February 2024 in Structures

This is how you can export a list of node locations to a .csv file from a named selection.

Tagged:

Comments

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

    Hi @Mike.Thompson , I'd recommend copying/pasting the code directly in the post for searchability and to avoid having to download some code we're not sure of the content.

  • aalperakis
    aalperakis Member Posts: 6
    First Anniversary Name Dropper First Comment
    **

    Thank you @Mike.Thompson. When I convert to Nodal Point in Named Selection, the export option also appears. But can we do the following? Can we export the names and centers (x, y, z) of the existing Named Selections? And maybe the type (edge-face-body) Then, I want to automatically generate the named selections in another model based on the location

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 367
    25 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    @aalperakis ,
    You can do this. The general idea would be to loop over the set of entities in the named selection. If it is a face, edge or body you can use the .Centroid property. This will give you the centroid in the GeoData unit system for XYZ. For a node or vertex there is an XYZ property directly since centroid does not apply.

    NS.Location is how to get the SelectionInformation object which store the SelectionType and the entities of the selection.

    You can write all of this information to a file, and then you can parse the information from that file with another model. You probably also want a tolerance of some value so small deviations are ignored. Something like centroids/points being within 1E-6mm, but the value should be based on your overall model for what is reasonable.