Application (class)#
- Application.__init__(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, optional) – Value of the API key. It can be found in Extranet under My Data. Every API key starts with ‘ak’ (default is None).
api_key_name (str, optional) – Name of the API key stored or to be stored. Can be any string of letters and numbers starting with ‘ak’, 51 characters long.
url (str, optional) – URL number.
port (int, optional) – Port number.
ssl (bool, optional) – False if NOT using SSL auth. True if using the installed version of SSL certificate, or path to .crt certificate if using a file.
ssl_file (str, optional) – Path to SSL certificate file (.crt, .pem).
Usage
from dlubal.api import rfem, common
# Initialize and connect the RFEM client
with rfem.Application() as rfem_app:
# Get application information to check connection
app_info = rfem_app.get_application_info()
print(f"\nApplication Info:\n{app_info}")
# Additional API calls can go here ...
Tip
The with context manager automatically closes the RFEM 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;
ApplicationRfem? RfemApp = null;
try
{
// Initialize and connect the RFEM client
RfemApp = new ApplicationRfem();
// Get application information to check connection
var appInfo = await RfemApp.get_application_info();
Console.WriteLine($"\nApplication Info:\n{appInfo}");
// Additional API calls can go here ...
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (RfemApp != null) await RfemApp.close_connection();
}