Results Access#
![]() |
In this example we will demonstrate how to:
|
from dlubal.api import rfem
with rfem.Application() as rfem_app:
# --- Retriev results from the active model (already calculated) ---
# 1. get_results: Returns all results of the specified type directly from the database.
# This is the full dataset, including all possible columns and data. Use this for custom analytics,
# advanced filtering, or to access values not shown in the GUI summary.
df_internal_forces = rfem_app.get_results(
results_type=rfem.results.ResultsType.STATIC_ANALYSIS_MEMBERS_INTERNAL_FORCES
).data
print(f"\nInternal Forces | All:")
print(df_internal_forces)
# 2. get_result_table: Returns a specific result table as it appears in the desktop GUI in default state.
# Only the most important values are included, mirroring what end users see for quick review or export.
df_internal_forces_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
)
).data
print(f"\nInternal Forces | Table:")
print(df_internal_forces_table)
# Both methods return a Table, which is a convenience wrapper around a pandas DataFrame.
# The DataFrame can be accessed directly via the .data attribute.
using Rfem = Dlubal.Api.Rfem;
using Microsoft.Data.Analysis;
ApplicationRfem? RfemApp = null;
try
{
RfemApp = new ApplicationRfem();
// --- Retriev results from the active model (already calculated) ---
// 1. get_results: Returns all results of the specified type directly from the database.
// This is the full dataset, including all possible columns and data. Use this for custom analytics,
// advanced filtering, or to access values not shown in the GUI summary.
DataFrame dfInternalForces = await RfemApp.get_results(
resultsType: Rfem.Results.ResultsType.StaticAnalysisMembersInternalForces
);
Console.WriteLine("\nInternal Forces | All:");
Console.WriteLine(dfInternalForces);
// 2. get_result_table: Returns a specific result table as it appears in the desktop GUI in default state.
// Only the most important values are included, mirroring what end users see for quick review or export.
DataFrame dfInternalForcesTable = await RfemApp.get_result_table(
table: Rfem.Results.ResultTable.StaticAnalysisMembersInternalForcesTable,
loading: new Rfem.ObjectId { No = 1, ObjectType = Rfem.ObjectType.LoadCombination }
);
Console.WriteLine("Internal Forces | Table:\n");
Console.WriteLine(dfInternalForcesTable);
// Both methods return a Microsoft.Data.Analysis.DataFrame object for easy data handling and export.
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (RfemApp != null) await RfemApp.close_connection();
}