In-app 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.

Important

Be aware that using certain API methods may incur additional costs (see Pricing & Credits) even when executed via the Console in the desktop application.

Configuration#

Before starting, ensure your system meets the following requirements:

  1. Check that API Service | gRPC is enabled in the Program Options & Settings dialog:

    • This dialog also includes details about the gRPC server port being used.

    • The default client/server communication port is 9000.

  2. In the Console window, select the Python | API Service | gRPC tab.:

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

  3. Install Client API directly in Console:

    • Run the following command to install the client version that matches your desktop application version:

      install_packages("dlubal.api==2.9.4")
      
    • Ensure that the last two numbers in the Dlubal API package version (e.g., 2.9.4) match the Dlubal desktop application version (e.g., X.09.0004) to prevent compatibility issues.

  4. Insert your API key into the installed package directory:

    • The recommended way to handle API keys is via the config.ini file (see Access Control)

    • For Windows installations, the config.ini file should be placed in:

      C:\Program Files\Dlubal\RFEM 6.09\bin\Lib\site-packages\dlubal\api\config.ini
      
    • This location depends on the installation settings chosen during setup.

    • It remains possible to insert API key directly in the script if preffered.

Running Scripts#

Scripts can be executed in the program using two methods:

  1. Using the Python Console | API Service | gRPC

    • Copy and paste the script into the console, then press Enter to execute it.

  2. Using the Script Manager

    • Select a script from the list and run it by double-clicking or using the context menu.

    • Ensure that the mode is set to API Service | gRPC before running the script.

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

_images/console_script_manager.png