|
[Sponsors] |
Run Ansys Journal Files in an opened Workbench from an external Python Script |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 1, 2022, 06:38 |
Run Ansys Journal Files in an opened Workbench from an external Python Script
|
#1 |
New Member
Join Date: Dec 2022
Posts: 2
Rep Power: 0 |
I am trying to run multiple Journal (.wbjn) Files in an opened, already prepared workbench project from an external Python script.
In my Python script i can open the workbench project with the following commands: ANSYS_exe_path = r'[Ansys Path]/runwb2.exe' Project_path = ' -I -F [Project Path]/Project.wbpj' subprocess.Popen("%s %s" % (ANSYS_exe_path, Project_path)) I tried to open the Journal with the following commands: Journal1_path = '-I -R [Journal Path]/Journal1.wbjn' subprocess.Popen("%s %s" % (ANSYS_exe_path, Journal1_path)) but with this command it will open a new empty workbench and tries to run the journal there, which results in a error because the journal is specific to the prepared workbench file. I can also add the commands to open the specific workbench to the journal file. Then it opens the workbench and runs the journal. This works but because i want to run multiple Journals and can not open the workbench everytime i can not use this way. So my question is how to open a journal file from python in a specific already opened workbench? |
|
March 24, 2023, 14:10 |
|
#2 |
New Member
Nesvik
Join Date: Mar 2023
Posts: 1
Rep Power: 0 |
Hi Lstar, did you have any luck regarding this? I am stuck at the same stage.
|
|
March 27, 2023, 03:42 |
|
#3 |
New Member
Join Date: Dec 2022
Posts: 2
Rep Power: 0 |
unfortunally not exactly, i have found one way that works for my problem though.
The way i did it was with the following python commands: ANSYS_exe_path = r'<ANSYS PATH>/runwb2.exe' Update_path = '-X -R ' + <PATH TO THE JOURNAL>/runUpdate.wbjn' p = subprocess.Popen("%s %s" % (ANSYS_exe_path, Update_path)) p.wait() #waiting for the process to conclude This subprocess will run the workbench journal "runUpdate.wbjn". The Journal "runUpdate.wbjn" will do two things: 1. Open the desired Workbench Project that i want to change, with the following command: Open(FilePath="<FilePath>/Design.wbpj") ... 2. Run a Journal that is specified for this Workbench Project with the following command: RunScript(FilePath="<FilePath>/FullUpdate.wbjn") When the Journals are finished the Ansys Workbench will close itself again so make sure that you include a save command at the end. |
|
Tags |
ansys workbench, journal file, python |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ANSYS Workbench on "Uncertified" Linux Distros | hsr | CFX | 289 | April 20, 2023 10:23 |
Export GLTF/GLB files via python script | claudio standteiner | EnSight | 0 | September 21, 2022 10:32 |
A CFX-POST error (ver 14.5.7) | wangyflp88 | CFX | 2 | July 22, 2017 01:17 |
FLUENT installation on UBUNTU 12.04 (LTS) | teymourj | FLUENT | 2 | March 1, 2017 23:24 |
critical error during installation of openfoam | Fabio88 | OpenFOAM Installation | 21 | June 2, 2010 04:01 |