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

Run Java macros in Star Ccm+

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   November 4, 2015, 10:32
Default Run Java macros in Star Ccm+
  #1
New Member
 
Join Date: Nov 2015
Posts: 2
Rep Power: 0
peter parkour is on a distinguished road
Hi!
I recently began programming in Java in order to do some pre-process into Star Ccm+.

The problem I have is when a play in Star Ccm+ a java macro wich calls another macro, Star throws a Instantiation Exception, like if the class was abstract or empty or something.

This is a silly example of what I'm trying with two simple macros (the classpath is correct). The second macro "crearprueba.java" calls the first macro "prueba.java" and set its data member "a" as value for BaseSize.

First class:

public class prueba
{
int a;
public prueba (int b)
{
a=b;
}
}




Second class:

import java.util.*;
import star.resurfacer.*;
import star.common.*;
import star.base.neo.*;
import star.meshing.*;

public class crearprueba extends StarMacro
{
public prueba Pr;
public crearprueba (prueba p)
{
Pr=p;
}

int metodo()
{
return Pr.a;
}

public void execute()
{
prueba paul = new prueba (3);

crearprueba hewson = new crearprueba (paul);

Simulation simulation_0 = getActiveSimulation();

MeshContinuum meshContinuum_0 = simulation_0.getContinuumManager().createContinuum (MeshContinuum.class);

meshContinuum_0.enable(ResurfacerMeshingModel.clas s);

meshContinuum_0.getReferenceValues().get(BaseSize. class).setValue(hewson.metodo());
}
}

Either if I play "prueba.java" or "crearprueba.java" Star Ccm+ throws "java.lan.InstantiationException: prueba/crearprueba"

Any ideas?

Thanks for all the solutions you can provide.
peter parkour is offline   Reply With Quote

 

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
How can I load Star CCM to Vista? student_58 STAR-CCM+ 0 December 21, 2012 17:29
a java error with installation of Star ccm+ greenfire STAR-CCM+ 1 November 26, 2012 17:15
how to open star ccm 6.04 version file in older versions pritam.edke Siemens 2 June 25, 2012 03:14
Working directory via command line Luiz CFX 4 March 6, 2011 20:02
How to run star design on unix AB Siemens 1 October 1, 2004 13:29


All times are GMT -4. The time now is 13:47.