CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CD-adapco (
-   -   macro editing in STAR-CCM+ (

JJ November 13, 2008 06:02

macro editing in STAR-CCM+
Hi Folks,

I'd like to export a few lines of data from my star-ccm+ model every time step.Could anyone give me tips on how to edit a macro for so that the process is repeated each time-step without overwriting?

Thanks for your help

ping November 13, 2008 10:23

Re: macro editing in STAR-CCM+
solve from within a Java macro

then in the macro have an infinite loop within loop

step one time step

print as below end loop

Here is a bit of code for openning and writing to a file:

String str1;

FileOutputStream fos;

DataOutputStream dos;

try {

File outFile= new File("MyFile.txt");

FileWriter out = new FileWriter(outFile);

// put your loop in here

str1 = "build your vars here" + " " + Area + " " ;

out.write( str1 );


} catch (IOException e) {



JJ November 13, 2008 18:53

Re: macro editing in STAR-CCM+
Thanks for your help ping, much appreciated

All times are GMT -4. The time now is 01:25.