I am looking for ways to automatically save the ocean script for a test state saved on a Cell in a given Library. I know how to do manually from ADE window, I am looking for a function or a reference code that does this. Please let me know if you are not clear on what I am asking for.
You can use asiOpenOceanScript/asiWriteOceanScript/asiCloseOceanScript, but this requires an "asi" session loaded with the state. There isn't really a way to directly go from a state to an OCEAN script without ADE being involved.
Maybe you could write a batch script which opened ADE, loaded the state, and then ran in "-nograph" mode.
Not entirely clear what precisely you're trying to do or why you're trying to do this.
First I am trying to run simulation on given cell and a saved test state w/o opening GUI (ie ADE). Second I want to grab the results of this run into some data files so I can keep log of them.
I have written a post processing script that takes a ocean script as input and outputs any value of expression to a file. For this to run in background, I would have to first save an ocean script from a given ADE state and then post process it.
Please let me know if there is a better way..
Andrew, Thanks for the reply. I accidentally clicked on quick reply, and it did not show up on the page immediately.
First, I would like to run simulation on a cell given a test state. Second grab the results of the run into data files for logging.
To do this, I am doing this way: 1. Save the ocean script for that state. 2. post process it to divert the output of some expressions to data files (using ocnPrint and other functions), I have written a custom script for this.
Since saving ocean script for that state is manual, I am trying to find a way to save this automatically and post process it with my custom script.
Does this make sense? or am I doing this in a complex way?
There's not really an easy way to do this, other than the approach I suggested before.
A colleague did file a CCR recently, 738431, to request a way in OCEAN to load from a state. So if you want something similar, you would need to contact customer support and request the same thing - and a duplicate enhancement request could be filed on your behalf.
Thanks. I will contact the customer service with the case number 738431 and add a duplicate enhancement request.
But here is another question on the same. I browsed all the files under the each state directory/cell view. I found a oceanscript.state file for each state, and I am thinking I can use this to post process and run in nograph/ or give to ocean as an input. What do you say on this? Does this file contain everything that state has saved last time?
if you can answer me on this, i can proceed in building my application.