Results Access#

../../../_images/results.png

In this example we will demonstrate how to:

  • Access all raw calculation results for a selected result type

  • Retrieve processed (GUI-style) result tables with just key data

  • Work with both result types as DataFrames for easy data handling and export

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.