TAGGED: #mechanical-#workbench
-
-
April 14, 2023 at 9:31 am
Oussama Hajjaj
SubscriberI wrote a script to rename the mechanical analyses according to their name in WB, but the problem is that if the analyses share the same model, they will have the same name as the last one in WB. the code is written in the script editor on Workbench.
cmd="""
for analysis in Model.Analyses:
analysis.Name='noname'
"""
oldname='noname'
systems=GetAllSystems()
for sys in systems:
try:
model= sys.GetContainer(ComponentName="Model")
newname=sys.DisplayText
cmd=cmd.replace(oldname,newname)
model.SendCommand(Language="Python",Command=cmd)
oldname=newname
except:
pass -
April 17, 2023 at 7:00 am
Aniket
Ansys EmployeeSo do you want to rename systems in Mechanical as per their name in Workbench system? From your script it looks like you are assigning 'noname' string to every system in Mechanical.
-Aniket
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
-
April 17, 2023 at 7:57 am
Oussama Hajjaj
SubscriberHello , yes it's for my internship and my supervisor asked me to make a script to rename systems in Mechanical as per their name in Workbench system.
I want ton change it and have some help , noname is the oldname , when using the commands after, i can change it to a newname. i should make the first for loop over a list but in my case it's just over one name of the list and i don't know how to solve it .
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Solver Pivot Warning in Beam Element Model
- Saving & sharing of Working project files in .wbpz format
- Understanding Force Convergence Solution Output
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- User manual
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- whether have the difference between using contact and target bodies
- material damping and modal analysis
- Colors and Mesh Display
-
5268
-
3299
-
2469
-
1308
-
1000
© 2023 Copyright ANSYS, Inc. All rights reserved.