Scripting Overview
The RS3 Scripting is a powerful API tool to automate modelling workflows and enhance analysis capabilities of RS3.
RS3 Scripting allows users to manipulate the model through Python scripts that access and control the program without the direct GUI interactions. This capability is advantageous can be advantageous in many aspects of numerical operations, for instance with scripting, users can:
- Automate RS3 modeling workflows by streamlining repetitive tasks for users of all levels
- Develop project-specific statistical analyses, parametric analyses, and other higher-level studies by integrating the API tool with the software
- Manage database for both model input parameters and computed results by utilizing the import/export to csv or equivalent features
- Customize scripts for projects of specific needs with the API library as well as other popular Python libraries to boost efficiency and flexibility
Methodology
Built upon the standard Python programming language, RS3 Scripting provides interaction with the software platform. The RS3 Python API Library contains comprehensive functions and modules to integrate with RS3.
Users can combine the RS3 Python API Library with popular Python libraries such as NumPy, Scikit-learn, TensorFlow, Pandas and Matplotlib to extend the level of data science and machine learning for engineering analysis.
RS3 Python Environment
The RocScript Editor serves as the pre-configured Python editor. The RS3 Python API Library is included with the RocScript installation package (see Installation section below).
Besides RocScript, users can alternatively use their own python environment. In this case, the RS3 Python API Library needs to be downloaded to their preferred code editor. See the Getting Started tutorial for detailed instructions on how to set this up.
Main Functions
The key components of the current RS3 Scripting functions are listed below. For more detail about RS3 Scripting functions, see the RS3 Python Reference Manual.
- Open/Close RS3 Application
- Open/Save/Close Model
- Save Compute file
- Control Project Settings
- Units
- Staging
- Stress Analysis Options
- Solver Options
- Groundwater Analysis Options
- Shear Strength Reduction Settings
- Dynamic Analysis Settings
- Add/delete water surface and pore water pressure grid
- Query and Modify (add/edit) Material, Joint, Support properties
- Role/Property/Name control for External volume entities
- Query and Control Field Stress parameters
- Query and Control Meshing
- Query volume and area of external volumes through selection
- Query external entities in contact with selected entity
- Compute Model
- Query results data of all analyzed entities through entity selection
Scripting Menu
Navigate to the Scripting menu to start using RS3 Scripting. The menu allows you to:
- Manage Scripting Server

- Launch RocScript Editor

- Manage Python Environment
- RocScript Editor Command Prompt - Open Scripting Reference Manual
For more details see the Scripting Tools topic.
Getting Started
To begin with RS3 Scripting, please see the Getting Started with RS3 Python Scripting.
Installation
If you do not have the RocScript Editor installed on your computer, you can download and install the program in one of two ways:
- Select Scripting > Scripting Options > Launch RocScript Editor
in the RS3 menu. If the program is not installed on your computer, you will automatically be directed to the RocScript Update History page where you can download the latest version of the tool. - Go to the Program Downloads page and download RocScript from the tools table.
Tutorials
The scripting tutorials demonstrate practical applications of the API tool, showcase the API function scripts, and exhibit potential performance for project-specific analyses. The Python script, initial and final model files are provided for each tutorial.
- Getting Started with RS3 Python Scripting
- Scripting Tunnel Tutorial (Part 1)
- Scripting Tunnel Tutorial (Part 2)
Community Guide
Review the RS3 Python Reference Guide for RS3 Scripting functions and using the API calls.