Application#

The dlubal.api.rfem.Application class serves as the gRPC client, offering full access to functionalities and underlying data, enabling seamless management and interaction with RFEM.


dlubal.api.rfem.Application.__init__(self, api_key_value=None, api_key_name=None, url='127.0.0.1', port=9000, ssl=False, ssl_file='', client_application_guid=None, client_application_signature=None, client_application_name=None, client_application_session_id=None)#

Initialize the RFEM client and connect to gRPC server.

Parameters:
  • api_key_value (str | None) – The API key for authentication, obtained from the Extranet > My Data. Can be skipped if an API key is stored in config.ini file.

  • api_key_name (str | None) – The name of a stored API key in the config.ini file. Used to retrieve the corresponding api_key_value. If not provided, the default API key will be used.

  • url (str | 127.0.0.1) – The gRPC server’s URL. Use this to connect to a remote server by specifying its IP.

  • port (int | 9000) – The server’s port number. Adjust if the server uses a different port.

  • ssl (bool | False) – Enables SSL encryption for secure communication.

  • ssl_file (str | None) – Path to the SSL certificate file (e.g., .crt). Used only if SSL encryption is enabled.

  • client_application_guid (str | None) – GUID of the client application opening the session (e.g. Dlubal CALC), as registered on the license server.

  • client_application_signature (str | None) – Signature issued by that client application for the API key. Sent only together with client_application_guid and client_application_name; the license server verifies it.

  • client_application_name (str | None) – Name of that client application as registered on the license server, which requires it to match the GUID’s.

  • client_application_session_id (str | None) – ID of the client application’s own session (e.g. the Dlubal CALC chat). Unsigned; sent only together with the client application’s identity.


Usage

from dlubal.api import rfem, common

# Initialize and connect the RFEM client
with rfem.Application() as rfem_app:

      # Create new model
      rfem_app.create_model(name="demo_model")

      # Create model object
      rfem_app.create_object(
         rfem.structure_core.Node(
            coordinate_1 = 3.0
         )
      )

Tip

The with context manager automatically closes the client-server connection when the block ends. If you instantiate rfem.Application() without with, remember to call close_connection() yourself.


Methods#