Results Access#
|
In this example we will demonstrate how to:
|
from dlubal.api import rfem, common
with rfem.Application() as rfem_app:
# --- get_results ---
# Retrieves complete, unprocessed results from the RFEM database.
# These results are returned wrapped in a DataFrame (.data).
results:common.Table = rfem_app.get_results(
results_type=rfem.results.ResultsType.STATIC_ANALYSIS_MEMBERS_INTERNAL_FORCES
)
print(f"\nResults:\n{results.data}")
# --- get_result_table ---
# Retrieves a pre-processed result table wrapped in a DataFrame (.data),
# containing only the most relevant values as displayed in the RFEM desktop application.
result_table:common.Table = rfem_app.get_result_table(
table = rfem.results.ResultTable.STATIC_ANALYSIS_MEMBERS_INTERNAL_FORCES_TABLE,
loading= rfem.ObjectId(
no=1,
object_type=rfem.OBJECT_TYPE_LOAD_COMBINATION
)
)
print(f"\nResult Table:\n{result_table.data}")
# --- has_results ---
# Checks if results exist for a specified loading condition.
# This is useful to confirm results availability before retrieving them,
# preventing errors or unnecessary data requests.
has_results = rfem_app.has_results(
loading = rfem.ObjectId
(
no = 1,
object_type = rfem.OBJECT_TYPE_LOAD_COMBINATION,
)
)
print(f"\nResults Available: {has_results.value}")
using Rfem = Dlubal.Api.Rfem;
using Common = Dlubal.Api.Common;
ApplicationRfem? RfemApp = null;
try
{
RfemApp = new ApplicationRfem();
// --- get_results ---
// Retrieves complete, unprocessed results from the RFEM database.
// These results are returned wrapped in a DataFrame (.Data).
Common.Table results = await RfemApp.get_results(
resultsType: Rfem.Results.ResultsType.StaticAnalysisMembersInternalForces
);
Console.WriteLine($"\nResults:\n{results.Data}");
// --- get_result_table ---
// Retrieves a pre-processed result table wrapped in a DataFrame (.Data),
// containing only the most relevant values as displayed in the RFEM desktop application.
Common.Table resultTable = await RfemApp.get_result_table(
table: Rfem.Results.ResultTable.StaticAnalysisMembersInternalForcesTable,
loading: new Rfem.ObjectId
{
No = 1,
ObjectType = Rfem.ObjectType.LoadCombination
}
);
Console.WriteLine($"\nResult Table:\n{resultTable.Data}");
// --- has_results ---
// Checks if results exist for a specified loading condition.
// This is useful to confirm results availability before retrieving them,
// preventing errors or unnecessary data requests.
var hasResults = await RfemApp.has_results(
loading: new Rfem.ObjectId
{
No = 1,
ObjectType = Rfem.ObjectType.LoadCombination,
}
);
Console.WriteLine($"\nResults Available: {hasResults}");
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (RfemApp != null) await RfemApp.close_connection();
}