RCL/2004

(RockWorks Command Language)
Preliminary Technical Reference

Last updated 02/09/04/JPR


Contents


Introduction

Almost all of the applications within RockWorks may be accessed, sans RockWorks menus, by placing special commands within an ASCII text file.  The target applications for this capability include;

  1. Users who wish to automate repetitive tasks.  Consider a user who monitors wells around 100+ gas stations.  Every quarter, new lab analyses are entered into the Borehole Manager.  A series of contour maps, cross-sections, fence-diagrams, solid-models, and volumetric analyses are then performed for each site.  The RCL provides a means for automating these processes and eliminating the drudgery of navigating through the menus.
     
  2. Developers of other applications who wish to use RockWorks as a subroutine library.  For example, let's say that a petroleum database software company would like to add contour maps to their product.  They would accomplish this by adding some code to perform the following operations;
     
    • Export data into a RockWorks-compatible format (e.g. ASCII tab-delimited XYZ).
    • Generate an RCL script to define contouring parameters and necessary commands.
    • Launch RockWorks with a command-line parameter that specifies the script-file name.

    The net result would be a contour map on the screen without the normal RockWorks menus.

    Note that it addition to running applications via an RCL script, it is also possible to display the RockWorks sub-menus.  This is often a more suitable way for third-party developers to use the RockWorks capabilities while providing their users with greater flexibility. 

Table of Contents


Launching The RCL Processor

There are four ways to launch the RCL processor;

  1. Select the Geological Utilities / Util / Compile RCL File option from within RockWorks and enter the name of the RCL script file that is to be processed.  This might be all that User #1 (see above) might ever need.  For User #2, this method is only suitable for de-bugging scripts.
     
  2. Create an RCL file and be sure to save the file with an ".rcl" extension.  Then, use the Windows Explorer program to associate the ".rcl" extension with the RockWorks program.  From now on, whenever you double-click on an RCL file within the Windows Explorer program, that file will be processed by the RCL "engine" within RockWorks.
     
  3. Use the Windows / Start / Run option to launch RockWorks with a command line parameter that specifies the name of the RCL script file.

    Example:  c:\program files\rockware\rw2002.exe "c:\projects\usgs coal\mycommands.rcl"

    Note: Command line parameter must be in enclosed by quotation marks to keep Windows from terminating the command parameter if there's a space in the file path.
     
  4. Execute (via the Windows "Shell") the RockWorks program from within another program.  By adding an RCL script file name to the command line parameter, RockWorks will attempt to process the associated file with the RCL engine.

Note (again): Command line parameter must be in enclosed by quotation marks to keep Windows from terminating the command parameter if there's a space in the file path.

The RCL (RockWorks Command Language) has been completely redesigned.  The previous RockWorks/2002 scheme, based on XML (eXtensible Markup Language), proved to be far too complex for casual use.  This new version consists of simple commands preceded by optional parameters.  Unlike the previous version, which only covered a few operations, the new RCL includes commands for almost every RockWorks application.

Table of Contents


RCL Script File Format

RCL commands are stored within tab or space-delimited ASCII files.  A typical command file consists of a series of "DEFINE" statements followed by an "EXECUTE" command.  The DEFINE statements define the parameters that are used by the associated EXECUTE command.  For example, let's say that you wanted to import an ASCII file into the RockWorks Geological Utilities datasheet.  You would begin by defining the name of the ASCII file that is to be imported and then you would execute the ASCII2ATD import program.

Example:

: Import ASCII data into Geological Utilities datasheet
: and create contour map.

DEFINE:  ASCII2ATD INPUT_FILE XYZ.txt
EXECUTE: ASCII2ATD

: Create contour map.

DEFINE:  EZMAP   X_COLUMN     1
DEFINE:  EZMAP   Y_COLUMN     2
DEFINE:  EZMAP   Z_COLUMN     3
DEFINE:  GENERAL 2D_OUTPUT    EZMAP.RKW
EXECUTE: EZMAP

All RCL commands must include a colon as the last character.

Examples:

DEFINE ASCII2ATD INPUT_FILE XYZ.txt <--- BAD (No colon after "DEFINE")
DEFINE: ASCII2ATD INPUT_FILE XYZ.txt <--- GOOD (Colon after "DEFINE")

Adding Comments

Blank lines and lines that begin with a colon in the first column are ignored by the RCL engine.  Comment lines are therefore preceded by a colon.

Example:

: Import Data Into Datasheet.

DEFINE:  ASCII2ATD INPUT_FILE ASCII XYZ.txt
DEFINE:  ASCII2ATD INCLUDES_HEADER  False
EXECUTE: ASCII2ATD

: Create EZ-Map.

DEFINE:  EZMAP   X_COLUMN  1
DEFINE:  EZMAP   Y_COLUMN  2
DEFINE:  EZMAP   Z_COLUMN  3
DEFINE:  GENERAL 2D_OUTPUT EZMAP.RKW
EXECUTE: EZMAP

: Convert EZ-Map To WMF Format.

DEFINE:  RP2D_WMF INPUT_FILE  EZMAP.RKW
DEFINE:  RP2D_WMF OUTPUT_FILE EZMAP.WMF
EXECUTE: RP2D_WMF

: Terminate RockWorks.

HALT:

Examples

The RockWorks tutorial folder (My Documents/RockWorks2004/Samples) include several sample RCL script files that are designed to be used in conjunction within the other tutorial files.  Please have a look at one of these files in order to get a feel for what an RCL file looks like.


Creating 2-D & 3-D Diagrams

Creating Two-Dimensional Diagrams

Before executing any procedure that creates two-dimensional diagrams, you must specify the name for the output (RKW graphic) file.  Otherwise,  RockWorks will leave the file name in an "undefined" state thereby producing an error .  This is accomplished by setting the GENERAL,2D_OUTPUT variable;

Example:

DEFINE:  2D_STRUCTURE STRAT_UNIT 1
DEFINE:  2D_STRUCTURE GRID_NAME  Structure01.grd
DEFINE:  GENERAL      2D_OUTPUT  Structure01.rkw <---
EXECUTE: 2D_STRUCTURE

Creating Three-Dimensional Diagrams

Before executing any procedure that creates three-dimensional diagrams, you must specify the name for the output (XML graphic) file.  Otherwise,  RockWorks will leave the file name in an "undefined" state thereby producing an error .  This is accomplished by setting the GENERAL,3D_OUTPUT variable;

Example:

DEFINE: GENERAL 3D_OUTPUT Stratigraphy Logs.xml <---
EXECUTE: LOG_FENCE

Table of Contents


Enabling & Disabling Diagram Display

Let's say that you want RockWorks to create a two-dimensional diagram but you don't necessarily want the user to see it (e.g. you intend to overlay the diagram later on with another diagram or you want to export the diagram to a bitmap format and then import it into your program).  This can be accomplished by disabling the automatic display within RockPlot/2D via the GENERAL,2D_DISPLAY setting;

Example:

DEFINE: GENERAL 2D_DISPLAY False

In a similar fashion, the automatic display of three-dimensional diagrams may also be supressed viat the GENERAL,3D_DISPLAY setting.

Example:

DEFINE: GENERAL 3D_DISPLAY False


RCL Commands

The following commands describe what may be entered into an RCL script file.


The DATASHEET Command 

DATASHEET: Hydrochemistry.atd

Table of Contents


The DEFINE Command

DEFINE:  IDATA_SOLID TRACK 1
DEFINE:  IDATA_SOLID NEW_MODEL_NAME Benzene.mod
DEFINE:  FENCELOC    SHOW_MAP       False
DEFINE:  FENCELOC    STYLE          2
DEFINE:  PROFILE     X1             652660
DEFINE:  PROFILE     Y1             5535000
DEFINE:  PROFILE     X2             653600
DEFINE:  PROFILE     Y2             5535980
DEFINE:  GENERAL     2D_OUTPUT      Benzene Profile.rkw
EXECUTE: IDATA_PROFILE


The EXECUTE Command

EXECUTE: EZMAP

Table of Contents


The EXIT Command

EXIT:

Table of Contents


The HALT Command

HALT:

Table of Contents


The MENU Command

MENU: TERNARY


The PROJECT Command

PROJECT: C:\SITE_27B

Table of Contents


The PROMPT Command

PROMPT: Gridding completed.  Press OK to contour the grid.

Table of Contents


The RESTORE Command

RESTORE:

Table of Contents


EXECUTE Command Options

The following table lists the available parameters for the EXECUTE command.

RockWorks Menu Item RCL Command Example
File  
   Project Folder PROJECT
   New Datasheet  
   New Log  
   Open Datasheet DATASHEET
   Erase  
   Save
   Save As
   Print
   Import  
      Into Borehole Manager  
         ASCII TEXT_2_BM
         RockWorks/99 RW99_2_BM
         Penetrometer PEN_IMPORT
         XLS XLS_2_BM
      Into Geological Utilities  
         ASCII ASCII2ATD RCL_01.txt
         DBF DBF_2_GU
         Delorme GPL DELORME
         DXF  
            ASCII DXF_2_XYZA
            DataGrid DXF_2_XYZB
         GSM-19 GSM19_IMP
         Laser Atlanta LASER_IMP
         ModPath MODPATH_IMP
         NEIC NEIC_IMPORT
         RockBase ROCKB_IMP
         SEG-P1 SEGP1_IMP
         XLS XLS_2_GU
   Export  
      From Borehole Manager  
         ASCII BM_2_TEXT
         Excel BM_2_XLS
      From Geological Utilities  
         ASCII GU_2_TEXT
         DBF GU_2_DBF
         XLS GU_2_XLS
   Transfer  
      Locations  
         Borehole Files -> Utilities Datagrid BM_LOC_2_GU  
         Utilities Datagrid -> Borehole Files GU_LOC_2_BM  
      Stratigraphy  
         Borehole Files -> Utilities Datagrid GU_2_BM  
         Utilities Datagrid -> Borehole Files BM_2_GU  
      Borehole Table -> Utilities BM_TAB_2_GU
   RockPlot2D  
   RockPlot3D  
   ReportWorks  
   Close EXIT & HALT
Edit  
   Digitize  
      Points
      Lines
   Filter
View  
   Restore RESTORE RCL_01.txt
   Locate
Borehole Manager  
   Lithology Table  
   Stratigraphy Table  
   Map (Borehole Manager)  
      Borehole Locations BOREHOLE_MAP RCL_04.txt
      Adjust Coordinates  
         Jeffersonian -> Easting/Northing SPOT_WELLS  
         Longitude/Latitude -> Easting/Northing    
   Striplogs  
      Single Log 2-D STRIPLOG_2D
      Single Log 3-D STRIPLOG_3D
      Multi-Log Profile LOG_PROFILE
      Multi-Log Section LOG_SECTION
      Multi-Log 3D LOG_FENCE RCL_05.txt
      Summary BH_SUMMARY
   Lithology  
      Profile LITH_PROFILE
      Section LITH_SECTION
      Fence LITH_FENCE RCL_05.txt
      Surface Map LITH_SURFACE
      Plan Map LITH_PLAN
      Model LITH_MODEL RCL_05.txt
      Volumetrics LITH_VOLUME
      Import  
         RockWorks99 Lithology LITH_RW99IMP
      Export  
         ASCII XYZG LITH_2_TEXT
         Lithology -> I-Data