Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.

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

ErKo
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

[bingo_chatbox]