Rocscience International Conference 2025 is going to take place in Sydney, Australia Read more

Search Results

Scripting Overview

The RS2 Scripting is a powerful API tool to automate modeling workflows and enhance analysis capabilities of RS2.

By leveraging RS2 Scripting, users can access to a wide range of benefits, including:

  • Automate RS2 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, RS2 Scripting serves seamless interaction with our software platform. The RS2 Python API Library contains comprehensive functions and modules to integrate with RS2.

Users can combine the RS2 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.

RS2 Python Environment

The RocScript Editor serves as the pre-configured Python editor. The RocScript Editor and the RS2 Python API Library are bundled with the RS2 installation package.

Besides RocScript, users can alternatively use their own python environment. In this case, the RS2 Python API Library needs to be downloaded to their preferred code editor. See more information in Getting Started tutorial.

Main Functions

The key components of the current RS2 Scripting functions are listed below. For more detail about RS2 Scripting functions, see the RS2 Python Reference Guide.

RS2 Modeler

  • Compute model
  • Modify material properties
    • Solid, fluid, thermal, and stage factor
  • Modify joint and support properties
    • Joints, bolts, piles, liners, composite liners, structural interfaces
  • Add time queries
  • Add history queries

RS2 Interpret

  • Display contour data
  • Mesh results
  • Support results
  • History query results
  • Time query results
  • Material query addition and analysis
  • Critical SRF value for SSR analysis

General

  • Open/Save/Close model
  • Import/Export csv

Please stay tuned with Rocscience for more integrated and powerful functions! Inquiries and suggestions are welcome here.

Scripting Menu

Navigate to the Scripting menu in either RS2 Modeler or RS2 Interpret to start using RS2 Scripting. The menu allows you to:

  • Manage Scripting Server
  • Open Scripting Editor
    • RocScript Editor
  • Manage Python Environment
    • RocScript Editor Command Prompt
  • Reference Manual

See each option in the topic.

Getting Started

To begin with RS2 Scripting, please see the Getting Started tutorial guide.

Tutorials

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.

Community Guide

The source code can be viewed at Github. More you can do in the community:

  • Look at the RS2 Python Reference Guide for RS2 Scripting functions and using the API calls.
  • If you find an issue with the library, you can “create an issue” on this page. You can even suggest a pull request to fix the problem.
    • Alternatively, you can always reach out to us through Get Support.

Rocscience logo, click here to return to the homepage Portal Account Portal Account Log In Log Out Home Shopping Cart icon Click here to search our site Click here to close Learning Tech Support Documentation Info Chevron Delete Back to Top View More" Previous Next PDF File Calendar Location Language External Link Apply to ACC External Link Fees Video Click here to visit Rocscience's LinkedIn page Click here to visit Rocscience's YouTube page Click here to visit Rocscience's X page Click here to visit Rocscience's Facebook page Click here to visit Rocscience's Instagram page Click here to visit Rocscience's Reddit page Bookmark Network Scroll down for more Checkmark Download Print Back to top Single User Multiple Users RSLog RocFall3 CPillar Dips EX3 RocFall RocPlane RocSlope3 RocSupport RocTopple RS2 RS3 RSData RSPile RSWall Settle3 Slide2 Slide3 SWedge UnWedge RocTunnel3 RocSlope2 BlastMetrix ShapeMetriX Fragmenter TestLicense Commercial License Education License Trial License Shop safe & secure Money-back guarantee