We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.

Ansys Learning Forum Forums Discuss Simulation General Mechanical Mechanical Scripting Reply To: Mechanical Scripting

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