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='')#
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.inifile.api_key_name (str | None) – The name of a stored API key in the
config.inifile. Used to retrieve the correspondingapi_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.
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.
using Rfem = Dlubal.Api.Rfem;
using Common = Dlubal.Api.Common;
using Google.Protobuf;
ApplicationRfem? RfemApp = null;
try
{
// Initialize and connect the RFEM client
RfemApp = new ApplicationRfem();
// Create a new model
await RfemApp.create_model(name: "demo_model");
// Create model object
await RfemApp.create_object(
new Rfem.StructureCore.Node{
Coordinate1=3.0,
}
);
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (RfemApp != null) await RfemApp.close_connection();
}
Methods#
- calculate_all
- calculate_specific
- close_all_models
- close_application
- close_connection
- close_model
- convert_objects
- create_model
- create_object
- create_object_list
- delete_all_objects
- delete_mesh
- delete_object
- delete_object_list
- export_to
- generate_combinations
- generate_mesh
- get_active_model
- get_application_info
- get_base_data
- get_design_settings
- get_mesh_settings
- get_mesh_statistics
- get_model_list
- get_model_main_parameters
- get_object
- get_object_id_list
- get_object_list
- get_result_table
- get_results
- get_subscription_info
- has_results
- import_from
- open_model
- plausibility_check
- save_model
- select_objects
- set_active_model
- set_base_data
- set_design_settings
- set_mesh_settings
- update_object
- update_object_list