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.
# 3. has_results: Checks if results exist for the specified loading condition.
# Use this before calling result retrieval methods to avoid 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"Has results: {has_results.value}")
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:\n{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($"\nInternal Forces | Table:\n{dfInternalForcesTable}");
// // Both methods return a Microsoft.Data.Analysis.DataFrame object for easy data handling and export.
// 3. has_results: Checks if results exist for the specified loading condition.
// Use this before calling result retrieval methods to avoid errors or unnecessary data requests.
var hasResults = await RfemApp.has_results(
loading: new Rfem.ObjectId
{
No = 1,
ObjectType = Rfem.ObjectType.LoadCombination,
}
);
Console.WriteLine($"\nHas results: {hasResults}");
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (RfemApp != null) await RfemApp.close_connection();
}