Hi Tomas,
I’m still having issues with this. My code is as follows:
# ------------------------------------------------------------
# Calculate all load cases and combinations
# ------------------------------------------------------------
# Toggle: Set to True to calculate all load cases/combinations,
# False to calculate only selected load combinations and concrete design
calculate_all = False
if calculate_all:
logger.info("Running full model calculation (calculate_all).")
rfem_app.calculate_all(skip_warnings=True)
else:
# Build list of ObjectId for load case 1 and the required combinations
loading = [
rfem.ObjectId(no=1, object_type=rfem.OBJECT_TYPE_LOAD_CASE)
]
# Add load combinations: 10–17, 20–27, 30–37, 40–47
for rng in [(10, 17), (20, 27), (30, 37), (40, 47)]:
loading.extend([
rfem.ObjectId(no=i, object_type=rfem.OBJECT_TYPE_LOAD_COMBINATION)
for i in range(rng[0], rng[1] + 1)
])
# Add pilecap-specific combinations if needed
if base_type == "pilecap_base":
for rng in [(50, 57), (60, 67)]:
loading.extend([
rfem.ObjectId(no=i, object_type=rfem.OBJECT_TYPE_LOAD_COMBINATION)
for i in range(rng[0], rng[1] + 1)
])
# Add punching shear combinations: 70–77 (ULS in-op), 80–87 (ULS out-op)
# These are used for punching shear design at base plate center nodes
for rng in [(70, 77), (80, 87)]:
loading.extend([
rfem.ObjectId(no=i, object_type=rfem.OBJECT_TYPE_LOAD_COMBINATION)
for i in range(rng[0], rng[1] + 1)
])
# Add design situations to ensure concrete design calculations are performed
# I just use DS1 and DS2
for ds_no in [1, 2]:
loading.append(
rfem.ObjectId(no=ds_no, object_type=rfem.OBJECT_TYPE_DESIGN_SITUATION)
)
try:
rfem_app.calculate_specific(
loadings=loading,
skip_warnings=True
)
logger.info("Selective calculation (LC1 + combinations 10-17, 20-27, 30-37, 40-47, 70-77, 80-87 + design situations) completed.")
except AttributeError:
# Older server build – fall back to full calculation
logger.warning("Selective-calculation API not available – running full model.")
rfem_app.calculate_all(skip_warnings=True)
except Exception as e:
# If calculate_specific fails for any reason, fall back to calculate_all
logger.warning("Selective calculation failed (%s) – falling back to full calculation.", e)
rfem_app.calculate_all(skip_warnings=True)
When I have calculate_all = True, I have no errors.
When I set it to False (ie I want to exclude primary load cases because they are unstable and slow caclulation time) I get an error at this line:
concrete_design_checks_df = rfem_app.get_results(
results_type=rfem.results.CONCRETE_DESIGN_SURFACES_DESIGN_RATIOS
).data
When I go into the model and select To Calculate everything I wanted to calculate was calculated, except Concrete Design.
So the code you gave above I suppose checks the To Design but it still doesn’t calculate Concrete Design so you can’t access the results in the API?
Am I understanding this correctly or is there a way to get that Concrete Design to calculate via the design situations and I am just coding wrong?
Thanks!
Samuel