Scripting Console#
This guide provides step-by-step instructions to configure the Console for in-app scripting using the Dlubal API within the desktop application of RFEM or RSTAB.
Warning
Please note that API methods are monetized (see Subscriptions & Pricing), even when executed through the Console in the desktop application.
Configuration#
Before you can run the Dlubal API scripts, you will need to set up the application and API client:
Make sure Dlubal API | gRPC is enabled in the Program Options & Settings dialog:
This dialog also shows details about the used gRPC server port.
The default port for client/server communication is
9000.
Switch to the Python | Dlubal API | gRPC console:
To display the Console window, navigate to the View tab in the menu bar.
Verify the Dlubal API package installation:
The Dlubal API Python package is automatically included in the RFEM, RSTAB, and RSECTION installation at:
C:\Program Files\Dlubal\RFEM 6.XX\bin\Lib\site-packages\
For older versions (prior to 2.13.1), install the package manually using the correct version number (e.g., API package
2.10.7corresponds to RFEM6.10.0007):install_packages("dlubal.api==2.10.7")
Set up the API key:
The easiest way to set the API key is by using the Enter Dlubal API Key tool. This tool automatically saves the key to the
config.inifile.The application will use this most recently entered API key for running scripts, unless a different key is specified directly within a script.
Alternatively, you can manually edit the API keys in the
config.inifile. The file is located at:C:\Users\<username>\AppData\Local\Dlubal\api\config.ini
Note
Prior to version 2.14.9, the file was located in the RFEM installation directory (
C:\Program Files\Dlubal\RFEM 6.x\bin\Lib\site-packages\dlubal\api\config.ini), which required running the application as administrator.
Running Scripts#
You can run scripts in three ways:
Using the Python | Dlubal API | gRPC console
Type or paste the script into the console, then press Enter to execute it.
Using the Script Manager
Select a script from the list. You can run it by either double-clicking it or using the context menu (right-click).
Ensure the mode is set to Python | Dlubal API | gRPC.
Importing a script file
To import a script, navigate to File -> Import -> Python Script | Dlubal API | gRPC in the menu bar.