Application#
The dlubal.api.rsection.Application class serves as the gRPC client, offering full access to functionalities and underlying data, enabling seamless management and interaction with RSECTION.
- dlubal.api.rsection.Application.__init__(self, api_key_value=None, api_key_name=None, url='127.0.0.1', port=9000, ssl=False, ssl_file='')#
Initialize the RSECTION 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 rsection, common
# Initialize and connect the RSECTION client
with rsection.Application() as rsection_app:
# Create new model
rsection_app.create_model(name="demo_model")
# Create model object
rsection_app.create_object(
rsection.structure_core.Point(
coordinate_1 = 3.0
)
)
Tip
The with context manager automatically closes the client-server connection when the block ends.
If you instantiate rsection.Application() without with, remember to call close_connection() yourself.
using Rsection = Dlubal.Api.Rsection;
using Common = Dlubal.Api.Common;
using Google.Protobuf;
ApplicationRsection? RsectionApp = null;
try
{
// Initialize and connect the RSECTION client
RsectionApp = new ApplicationRsection();
// Create a new model
await RsectionApp.create_model(name: "demo_model");
// Create model object
await RsectionApp.create_object(
new Rsection.StructureCore.Point{
Coordinate1=3.0,
}
);
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (RsectionApp != null) await RsectionApp.close_connection();
}
Methods#
- calculate_all
- close_all_models
- close_application
- close_connection
- close_model
- create_model
- create_object
- create_object_list
- delete_all_objects
- delete_object
- delete_object_list
- get_active_model
- get_application_info
- get_base_data
- get_model_list
- get_model_main_parameters
- get_object
- get_object_id_list
- get_object_list
- get_subscription_info
- open_model
- plausibility_check
- save_model
- select_objects
- set_active_model
- set_base_data
- update_object
- update_object_list