In Mechanical scripting how can I create a Named Selection that is scoped to a list of node numbers?
Landon Mitchell Kanner
Member, Employee Posts: 291
✭✭✭✭
I have a list of node numbers in a CSV file. I would like to create a named selection with the node numbers, so that I can visualize where are these nodes located at the mesh.
Is this possible with Mechanical Scripting?
Tagged:
0
Answers
-
nodeIDs = [1,3,9] ns = ExtAPI.DataModel.Project.Model.AddNamedSelection() ns.ScopingMethod = ns.ScopingMethod.Worksheet for nodeID in nodeIDs: criterion=Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion() criterion.Action= criterion.Action.Add criterion.EntityType = criterion.EntityType.MeshNode criterion.Criterion = criterion.Criterion.NodeNumber criterion.Operator = criterion.Operator.Equal criterion.Value = nodeID ns.GenerationCriteria.Add(criterion) ns.Generate()
0