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

StarCCM+ Command line options and Macro execution

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 23, 2012, 14:40
Default StarCCM+ Command line options and Macro execution
  #1
New Member
 
Join Date: Oct 2012
Location: Italy
Posts: 4
Rep Power: 14
isidp is on a distinguished road
Hi to all,

I've written a Star-CCM+ Macro that uses a jar library. From the Star-CCM+ GUI it works because I've set the "User Macro classpath" (Menu Tools=>Options=>Environment).

Now, I want to run the same macro from command line. Into documentation there is a command line option "-classpath" that should overried the "User macro classpath", but it doesn't work. Obviously, I've removed the "User macro classpath" option

The command line is:
Code:
starccm+ -classpath "C:\libs" -m MyMacro.java simulation
but it gets an error window: package xyz does not exist ... cannot find symbol. It seems that it cannot find the jars and that the classpath setting from command line fails.

Thanks
isidp is offline   Reply With Quote

Old   October 23, 2012, 15:30
Default
  #2
New Member
 
Join Date: Jun 2009
Posts: 9
Rep Power: 17
sgrshukla is on a distinguished road
classpath is the location of class library used for the macro. where your .jar files if located in different directory.. If you just recorded macro then just run it without providing classpath.
sgrshukla is offline   Reply With Quote

Old   October 24, 2012, 05:29
Default
  #3
New Member
 
Join Date: Oct 2012
Location: Italy
Posts: 4
Rep Power: 14
isidp is on a distinguished road
Hi sgrshukla,

Quote:
Originally Posted by sgrshukla View Post
If you just recorded macro then just run it without providing classpath.
I've written the macro and it uses an external jar. I need the classpath to specify the jar location.

So, from GUI it works (I've added the classpath to "User macro classpath"), but it doesn't work from command line with the option "-classpath"
isidp is offline   Reply With Quote

Old   October 24, 2012, 14:42
Default
  #4
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 636
Rep Power: 22
abdul099 is on a distinguished road
Linux or Windows?
__________________
We do three types of jobs here:
GOOD, FAST AND CHEAP
You may choose any two!
abdul099 is offline   Reply With Quote

Old   October 24, 2012, 14:44
Default
  #5
New Member
 
Join Date: Oct 2012
Location: Italy
Posts: 4
Rep Power: 14
isidp is on a distinguished road
Hi abdul099,

Now, I'm working on Windows operating system.
isidp is offline   Reply With Quote

Old   October 24, 2012, 18:04
Default
  #6
New Member
 
Join Date: Jun 2009
Posts: 9
Rep Power: 17
sgrshukla is on a distinguished road
I think you also want to add "-batch" in command line before macro name and filename.
sgrshukla is offline   Reply With Quote

Old   January 29, 2013, 04:21
Default Star CCM+ Unable to access JAR in Linux Envi
  #7
New Member
 
aparajitha
Join Date: Nov 2012
Posts: 3
Rep Power: 14
aparajitha is on a distinguished road
Hi All,

I wrote a mcro using some supporting JAR.

I have added the both JAR path and macro path in "User Macro ClassPath" Settings also.

But my macro is unable to find the '.JAR' i have used.

Iam using Star CCM+ 7.04 in linux environment.

Kindly help me.

Thanks,
aparajitha
aparajitha is offline   Reply With Quote

Old   January 29, 2013, 04:39
Smile [SOLVED] StarCCM+ Command line options and Macro execution
  #8
New Member
 
Join Date: Oct 2012
Location: Italy
Posts: 4
Rep Power: 14
isidp is on a distinguished road
Hi,

I'm going to describe the solution to my initial post and some tricks that I've faced. Solution is for Windows Operating System but It can be easily adapted for linux environment.

-------
It's possible to override macro libraries path (classpath) from command line only with "-batch" option otherwise you should set library path from GUI into "User Macro ClassPath" window. It's an example of command line macro execution:

Quote:
starccm+ simfile.sim -batch MyMacro.java -classpath "C:\libs"
Finally, classpath string (e.g. "C:\libs") hasn't the "\" char at the end; I've gets some errors terminating path with blackslash as last character.
----

Thanks to all.

Last edited by isidp; January 29, 2013 at 06:05.
isidp is offline   Reply With Quote

Old   January 29, 2013, 06:00
Default
  #9
New Member
 
aparajitha
Join Date: Nov 2012
Posts: 3
Rep Power: 14
aparajitha is on a distinguished road
Hey,

It's in Linux environment..

Also, starccm+ command is giving me error: "Command not found"

Iam giving this command from path where ccm is installed.

Thanks in advance..
aparajitha is offline   Reply With Quote

Reply


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
Macro Heat Exchanger not selecting (Please help!) zdeth FLUENT 2 September 11, 2012 14:52


All times are GMT -4. The time now is 16:35.