TAGGED: mechanical, named-selection, script
-
-
July 14, 2023 at 3:05 pm
Karan Bhuta
SubscriberI want to select my entire geometry everytime even if I make changes in my spaceclaim. Can I do that?
-
July 14, 2023 at 3:35 pm
Erik Kostson
Ansys EmployeeHi
Can you explain more what you want to do?
And why do you need scripting?
The more info your provide the more feedback you can get from the forum users.
All the best
Erik
-
July 14, 2023 at 3:40 pm
Karan Bhuta
SubscriberI have made a script in spaceclaim that will change the dimensions of my geometry everytime I change a single input according to my requirement. Now I want to do analysis on that geometry using mechanical scripting. Now when I go back to hange my geometry in space claim and update the dimensions there, the selections made in mechanical needs to be made again manually. I want to know if there is a way I can script to make the selection automatically even when I update the geometry.
-
July 14, 2023 at 6:13 pm
Erik Kostson
Ansys EmployeeHi
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
-
July 14, 2023 at 7:32 pm
Karan Bhuta
SubscriberHi ,
Thank you for that tip it really helped. The face I have selected is kind of the end face and the changes I make in the spaceclaim script changes the end faces' position everytime which results in change in the face number that face. I want to select the end face every time, can I do that?
Â
-
- The topic ‘Mechanical Scripting’ is closed to new replies.
-
3029
-
971
-
858
-
851
-
792
© 2025 Copyright ANSYS, Inc. All rights reserved.