Ansys Learning Forum › Forums › Discuss Simulation › General Mechanical › Mechanical Scripting › Reply To: Mechanical Scripting
July 14, 2023 at 6:13 pm
Erik Kostson
Ansys Employee
Hi
One way I use is to scope say loads, etc. to named selections (ns) and not goemetry in Mechanical. In that way it all works.
To create a named selecton in Spaceclaim as an example of a body (first body in the tree) via script (or one can create the ns manualy inside Spaceclaim):
selection = BodySelection.Create(GetRootPart().Bodies[0])
secondarySelection = Selection.Empty()
resultns = NamedSelection.Create(selection, secondarySelection)
All the best
Erik