DIAL Scripts

A DIAL script is written as plain text using a text editor. This text file is a set of tokens, optionally separated by white space (spaces, tabs, and line-feeds). Every DIAL script must start with the following statements:

  • DiveLine connect or DiveLine set webdir
  • set project
  • open

The open statement accesses a cBase, Model, Marker, DiveBook, or Lookup. More identifiers, comments, expressions, or statements can be included. Although not required, it is a good practice to end the DIAL script with a DiveLine disconnect statement.

NOTE: Starting with 7.1(15), running DIAL scripts from Workbench or a Production script in server mode alter these requirements. See DIAL Server Mode.

The following example shows a basic DIAL script that connects to the DiveLine server and opens a Model through a DivePlan. A status line is written to the console before and after opening the Model. The script ends with the disconnect statement.

Example:

diveline.set_webdir("/di/solution/dl-dataroot/webdir");
diveline.connect("localhost", "dial_user");
diveline.set_project("myProject");
 
console.writeln("Opening sales.dvp...");
model.open(mymodel,"/models/an_sales.dvp");
 
console.writeln("Done!");
diveline.disconnect();