-
-
February 26, 2023 at 8:56 pm
m.vp2209
SubscriberHi
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()[1]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 pm
Aniket
Forum ModeratorIf 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?
-Aniket
-
- 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.
- How to do the frequency response of the nonlinear vibration of a flexible PCB?
- Importing Line and Solid Bodies from SpaceClaim to Mechanical
- how to open SendCommand in Ansys
- problems facing during solution
- Still facing the same issue
- Failed to move file from solver directory to scratch directory: file.rst
- Adaptive Sizing
- Stiffness factor
- Import DAT file
- Import pressure data (coordinates and value) to ansys workbench through excel
-
8824
-
4658
-
3155
-
1688
-
1482
© 2023 Copyright ANSYS, Inc. All rights reserved.