How to export node coordinate locations from a Named Selection
This is how you can export a list of node locations to a .csv file from a named selection.
Comments
-
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.
0 -
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
0 -
@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.
0