CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CD-adapco (http://www.cfd-online.com/Forums/cd-adapco/)
-   -   Java form and star ccm+ (http://www.cfd-online.com/Forums/cd-adapco/56688-java-form-star-ccm.html)

Itoa June 26, 2008 12:10

Java form and star ccm+
 
hi

I want develop a form using java which can read the messages from the output window. But i don't know how to get the messages from star ccm+ to my text box. Please help me out.

Thanks in advance.

steve July 2, 2008 10:15

Re: Java form and star ccm+
 
Hi

I guess that you want to get value of a report from the output window to a java variable. Is that correct?

Perhaps you could try the following

Create the report, here I am using a maximum.

In your macro do something like:

// STAR-CCM+ macro: myMacro.java package macro;

import java.util.*;

import star.common.*; import star.base.report.*;

public class myMacro extends StarMacro {

public void execute() {

Simulation simulation_0 =

getActiveSimulation();

MaxReport maxReport_0 =

((MaxReport) simulation_0.getReportManager().getReport("Maximum 1"));

double xx=maxReport_0.monitoredValue();

simulation_0.println("value "+xx);

} }

Does this help? The API which you can find under the Help is very useful here.



All times are GMT -4. The time now is 07:52.