01.12.2012 Views

OrcaFlex Manual - Orcina

OrcaFlex Manual - Orcina

OrcaFlex Manual - Orcina

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

w<br />

4.2.2 Script Files<br />

87<br />

Automation, Batch Processing<br />

<strong>OrcaFlex</strong> provides special facilities for running a series of variations on a base data file, using a script file. This<br />

contains a sequence of commands to read a data file, make modifications to it, and run the modified file, storing the<br />

results for later processing. The file can also include comments. The syntax for the instructions is described in the<br />

next topic.<br />

Script files can be written using any text editor. However, it is quite unusual to do this because there are very<br />

productive facilities in the <strong>OrcaFlex</strong> spreadsheet for automatically generating script files for regular sets of cases.<br />

A more recently introduced alternative to script files are text data files. These can be used to specify load case<br />

variations. Once again, the <strong>OrcaFlex</strong> spreadsheet offers a facility to generate these text data files.<br />

4.2.3 Script Syntax<br />

An <strong>OrcaFlex</strong> batch script is made up of commands, which are obeyed sequentially, and comments, which are<br />

ignored. A comment is a line that is either blank or on which the first non-blank characters are "//". A command can<br />

be:<br />

1. A directive followed by one or more arguments, optionally separated by white space (one or more spaces or<br />

tabs). For example: load c:\temp\test.dat where load is the directive and c:\temp\test.dat is the<br />

argument.<br />

2. An assignment of the form VariableName=value, again with optional white space separators. For example:<br />

Length = 55.0.<br />

Note that:<br />

� Directives, variable names, and model object names are all case independent.<br />

� If your script includes a relative file name then it is taken to be relative to the directory from which the script<br />

was loaded.<br />

� File names, arguments, variables or values containing spaces or non-alphanumeric characters must be enclosed<br />

in single or double quotes and they must not contain the same quote character as is used to enclose them. For<br />

example '6" pipe' and "200' riser" are valid, but the following are not valid:<br />

6 inch pipe – contains spaces, so needs to be enclosed in quotes;<br />

6"pipe – contains a double quote, so needs to be enclosed in single quotes;<br />

'6' pipe' – contains a single quote, so needs to be enclosed in double quotes instead of single.<br />

4.2.4 Script Commands<br />

The script commands are executed in the context of an active model. This can be either an <strong>OrcaFlex</strong> model<br />

containing Vessels, Lines etc., or a Fatigue Analysis. The active model defaults, at the start of script execution to<br />

being an <strong>OrcaFlex</strong> model. The active model can change due to a Load/LoadData command, or following a<br />

NewModel/NewFatigue command. Some of the commands have different interpretations, depending on what type<br />

of model is active, as described below.<br />

The following batch script commands are currently available. You need to put quotes round file names or other<br />

parameters that include spaces or non-alphanumeric characters.<br />

Load <br />

Opens the <strong>OrcaFlex</strong> file named . The file can be a data file, a simulation file or a fatigue analysis file.<br />

LoadData <br />

Opens the data from the <strong>OrcaFlex</strong> data file named .<br />

RunStatics <br />

Perform statics for the current model and save the resulting simulation to . After the file is saved the<br />

model is reset.<br />

RunDynamics <br />

Run dynamics for the current model and save the resulting simulation to . After the file is saved the<br />

model is reset.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!