RCL/2004
(RockWorks Command Language)
Preliminary Technical Reference
Last updated 02/09/04/JPR
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;
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.
There are four ways to launch the RCL processor;
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.
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 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
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
The following commands describe what may be entered into an RCL script file.
Purpose:
Loads a specified ATD (ASCII Tab-Delimited) file into the Geological Utilities datasheet.
Parameters:
File Name: Name of ATD file that is to be loaded into the Geological Utilities Datasheet.
Example:
DATASHEET: Hydrochemistry.atd
Purpose:
Define a variable setting (something that would normally be accomplished via a menu).
Parameters:
Group Name:
Item Name:
Variable Setting:
Example:
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
Comments:
The two-part variable name follows the same syntax as the Windows registry and Windows INI files.
The final item is the actual setting that is to be assigned to a variable.
Purpose:
Launches a RockWorks task (e.g. generating a contour map).
Parameters:
Application Name: Click here to view a list of available commands.
Example:
EXECUTE: EZMAP
Comments:
Be sure to define all necessary variables (via the DEFINE) command before listing the EXECUTE command.
Purpose:
The EXIT command will terminate the RCL processing and display the main RockWorks menu.
Parameters:
None.
Example:
EXIT:
Comments:
If you wish to terminate RockWorks without showing the RockWorks menu, use the HALT command instead.
Purpose:
The HALT command will terminate the RCL as well as RockWorks.
Parameters:
None.
Example:
HALT:
Comments:
If you wish to terminate the RCL process but return to the RockWorks menu, use the EXIT command instead.
Purpose:
The MENU command is used to display a RockWorks menu.
Parameters:
Menu Name:
Example:
MENU: TERNARY
Comments:
If the user selects the OK option from this menu, the program will perform the appropriate operation. Conversely, if the user select the Cancel option from within this menu, the RCL scripting will continue without returning to the main RockWorks menu.
Purpose:
The PROJECT command is used to define the folder (aka directory) in which all of the data is stored.
Parameters:
Folder Name:
Example:
PROJECT: C:\SITE_27B
Comments:
It is important that the PROJECT command be listed at the top of the
Purpose:
The PROMPT command is used to display a simple message on the screen.
Parameters:
Caption: The message that will be displayed within the dialog box.
Example:
PROMPT: Gridding completed. Press OK to contour the grid.
Comments:
Purpose:
Restore all menu settings to their original default states.
Parameters:
None.
Example:
RESTORE:
Comments:
The defaults values are defined within the Menus.txt file that is stored within the \Program Files\RW2004\Tables folder.
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 | ||
| 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 |