|
[Sponsors] |
November 4, 2015, 10:32 |
Run Java macros in Star Ccm+
|
#1 |
New Member
Join Date: Nov 2015
Posts: 2
Rep Power: 0 |
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. |
|
Tags |
java macro, star ccm+ |
|
|
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 |