February 26, 2023 at 8:56 pmm.vp2209Subscriber
I am writting a code which saves my temperature solutions directly as a text file after the solution is calculated. For the name of the .txt file I would like to also include the name of my system. In my project I have many systems and I want to just get the name (Display Text) of the system that is currently in use, without having to know its index in the project.
My current code to get the Display name of the project and which runs in Mechanical looks like:import wbjnWB_cmds="""system1 = GetAllSystems()my_name = system1.DisplayTextreturnValue(my_name)"""system_name=wbjn.ExecuteCommand(ExtAPI,WB_cmds)then I use the system_name to create a filepath where the txt file of the solution should be stored.
Unfortunately, this is not what I want because I would have to know the GetAllSystems index of every system and change it manually.
I have also though about using GetSystem(Name="Static1"), but I run into the same problem that I would have to know the name of the system to start with, rather than retrieving it from WB.
Do you have any better approaches?
March 2, 2023 at 6:02 pmAniketAnsys Employee
If you are using a workbench-level script and SendCommand API to Mechanical as mentioned on the other thread, you can take this DisplayText directly to Mechanical, to export the files. Will that work?
How to access Ansys help links
- 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.
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.
- Saving & sharing of Working project files in .wbpz format
- Solver Pivot Warning in Beam Element Model
- 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
- whether have the difference between using contact and target bodies
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- User manual
- Colors and Mesh Display
- material damping and modal analysis
© 2023 Copyright ANSYS, Inc. All rights reserved.