Dear Dlubal Community
I would like to compare two models via dlubal.api. Both models are opened in the same RFEM GUI. My code looks as follows:
from dlubal.api import rfem
import pandas as pd
rfem_model_path0 = r"Y:\\...\\4269_20260227_v0_Gebäudemodell.rf6"
rfem_model_path1 = r"Y:\\...\\4269_20260304_v1_Gebäudemodell.rf6"
)
def get_result_table_for(load_case_no: int) -> pd.DataFrame:
return rfem_app.get_result_table(
table=rfem.results.ResultTable.MODAL_ANALYSIS_MASSES_IN_LOCATIONS_TABLE,
loading=rfem.ObjectId(no=load_case_no, object_type=rfem.OBJECT_TYPE_LOAD_CASE)
).data
with rfem.Application() as rfem_app:
mlist = rfem_app.get_model_list()
print(mlist)
id0 = rfem_app.open_model(path=rfem_model_path0)
rfem_app.set_active_model(model_id=id0)
v0_data = get_result_table_for(load_case_no=4)
id1 = rfem_app.open_model(path=rfem_model_path1)
rfem_app.set_active_model(model_id=id1)
v1_data = get_result_table_for(load_case_no=4)
Response of the print statement:
>>>
model_info {
name: "4269_20260304_v1_Gebäudemodell"
guid: "f7b45932-9de5-4638-bbd7-9cdce4771abe"
path: "Y:/.../4269_20260304_v1_Gebäudemodell.rf6"
}
model_info {
name: "4269_20260227_v0_Gebäudemodell"
guid: "f7b45932-9de5-4638-bbd7-9cdce4771abe"
path: "Y:/.../4269_20260227_v0_Gebäudemodell.rf6"
}
My questions:
- The DataFrames
v0_dataandv1_dataare identical - presumably because the guid is the same. Shouldn't the models be assigned different guids? - How do I correctly address multiple opened models?
- Is it possible to read results from models via the API without opening them in the GUI?
Thanks for your help.
Lucas