CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Opening a Simulation file using JAVA Macro

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2015, 08:39
Default Opening a Simulation file using JAVA Macro
  #1
New Member
 
Vibhor pandey
Join Date: Aug 2014
Posts: 3
Rep Power: 11
Vibh is on a distinguished road
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!
Vibh is offline   Reply With Quote

Old   April 4, 2015, 06:47
Default
  #2
New Member
 
Tim Meier
Join Date: Mar 2015
Posts: 16
Rep Power: 11
TimCFD is on a distinguished road
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.
TimCFD is offline   Reply With Quote

Old   June 1, 2022, 10:59
Default
  #3
New Member
 
yang
Join Date: Jun 2022
Posts: 1
Rep Power: 0
yxiang is on a distinguished road
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);
yxiang is offline   Reply With Quote

Reply

Tags
java macro, star ccm+


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 03:30
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 01:22
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 13:14
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 13:59
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


All times are GMT -4. The time now is 20:28.