Application Console#

This guide provides step-by-step instructions to configure the Console for in-app scripting using the Dlubal API within the desktop application.

Important

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 install the Dlubal API package (i.e. client):

  1. Make sure API Service | 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.

  2. Switch to the Python | API Service | gRPC console:

    • To display the Console window, navigate to the View tab in the menu bar.

  3. Install the Dlubal API package:

    • The simplest way to install the Dlubal API package is by using the built-in install_packages function. Type the following command into the console and press Enter. This will install the latest Dlubal API package:

      install_packages("dlubal.api")
      
    • To install a specific version, include the version number in the function call. For example, to install package version 2.10.7, use:

      install_packages("dlubal.api==2.10.7")
      

    Important

    Ensure that the last two numbers in the Dlubal API package version (e.g., 2.10.7) match the Dlubal desktop application version (e.g., X.10.0007) to prevent compatibility issues.

  4. Setup the API key:

    • The easiest way to set the API key is by using the Enter ‘API Service | gRPC’ Key tool. This tool automatically saves the key to the config.ini file.

    • 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.ini file. For a typical Windows installation, you will find this file at:

      C:\Program Files\Dlubal\RFEM 6.10\bin\Lib\site-packages\dlubal\api\config.ini
      

    Note

    The exact location may vary depending on the installation path you chose during setup.

Running Scripts#

You can run scripts in three ways:

  1. Using the Python Console | API Service | gRPC

    • Type or paste the script into the console, then press Enter to execute it.

  2. 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 | API Service | gRPC.

  3. Importing a script file

    • To import a script, navigate to File -> Import -> Python Script | API Service | gRPC in the menu bar.