|
[Sponsors] |
April 1, 2015, 09:39 |
Opening a Simulation file using JAVA Macro
|
#1 |
New Member
Vibhor pandey
Join Date: Aug 2014
Posts: 3
Rep Power: 12 |
Hi! I am writing a JAVA Macro for performing an arithmetic operation on an exported X,Y,Z Coordinates' file from STAR CCM+ to get a new set of X,Y and Z. To do so, I need to open in between a different Simulation file.
(For ex- If I have presently opened File0.sim, and on which my JAVA Macro is currently executing its commands. How do I, from Macro, open a different Simulation File1.sim?) Is there a way to do this? Any suggestion would be highly helpful! Thank you! |
|
April 4, 2015, 07:47 |
|
#2 |
New Member
Tim Meier
Join Date: Mar 2015
Posts: 16
Rep Power: 11 |
I´m not an expert in Java scripting, but the starting point for me is always a recording. In your case File0.sim is open, start to record a Java macro, go to files, load simulation File1.sim, stop recording and have a look at the macro.
Two simulations are now open in your GUI and you can perform the next steps. |
|
June 1, 2022, 11:59 |
|
#3 |
New Member
yang
Join Date: Jun 2022
Posts: 1
Rep Power: 0 |
1. Open new session from a sim file (return nothing and scripts does not wait):
star.coremodule.OpenFile.open(simPath); // wait seconds for fully initilizing // the new session become active automatically. Simulation sim=getActiveSimulation(); 2. Get Simulation object from a sim file(doesn't visually open in a session): Simulation sim = new Simulation(simPath); // do something then close it... sim.close(star.base.neo.ServerConnection.CloseOpti on.ForceClose); |
|
Tags |
java macro, star ccm+ |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
[swak4Foam] swak4Foam-groovyBC build problem | zxj160 | OpenFOAM Community Contributions | 18 | July 30, 2013 14:14 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |