Calculation of Steel Design with API

Hello everyone,
I am trying to get the UZ and UY displacements from my calculation of steel design. With help @c.poupin i created the code that works and give ratio and case:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
sys.path.append(r"C:\Program Files\Autodesk\Robot Structural Analysis Professional 2025\Exe")
clr.AddReference("interop.RobotOM")
from RobotOM import RobotApplicationClass, IRDimCalcParamVerifType, IRDimCalcParamLimitStateType
clr.AddReference("System.Reflection")
from System.Reflection import BindingFlags
from RobotOM import * 
from System import Object


objects = IN[0]

app = RobotApplicationClass()
project = app.Project
project.ViewMngr.Refresh()
rdm_server = IRDimServer(app.Kernel.GetExtension("RDimServer"))
rdm_server.Mode = 1
rdm_calc_engine = IRDimCalcEngine(rdm_server.CalculEngine)
calc_param = IRDimCalcParam(rdm_calc_engine.GetCalcParam())
calc_conf = rdm_calc_engine.GetCalcConf()
stream = IRDimStream(rdm_server.Connection.GetStream())
stream.Clear()
stream.WriteLong(1)
calc_param.SetObjsList(IRDimCalcParamVerifType.I_DCPVT_GROUPS_DESIGN,stream)
calc_param.SetLimitState(IRDimCalcParamLimitStateType.I_DCPLST_ULTIMATE,1)
stream.Clear()
stream.WriteText("all")
calc_param.SetLoadsList(stream)
rdm_calc_engine.SetCalcParam(calc_param)
rdm_calc_engine.Solve(None)
all_results = IRDimAllRes(rdm_calc_engine.Results())
grp_results = IRDimGrpRes(all_results.Get(1))
if grp_results.Check(0, IRDimGrpResCurrProf.I_DGRCP_GOVERNING):
    detailed_results = IRDimDetailedRes(grp_results.Get(0, IRDimGrpResCurrProf.I_DGRCP_GOVERNING))
    case = detailed_results.GovernCaseName
    ratio = detailed_results.Ratio
    print(ratio)
    print(case)
    OUT = case, ratio

I modified the code above and got:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
sys.path.append(r"C:\Program Files\Autodesk\Robot Structural Analysis Professional 2025\Exe")
clr.AddReference("interop.RobotOM")
from RobotOM import RobotApplicationClass, IRDimCalcParamVerifType, IRDimCalcParamLimitStateType
clr.AddReference("System.Reflection")
from System.Reflection import BindingFlags
from RobotOM import * 
from System import Object


objects = IN[0]

app = RobotApplicationClass()
project = app.Project
project.ViewMngr.Refresh()
rdm_server = IRDimServer(app.Kernel.GetExtension("RDimServer"))
rdm_server.Mode = 1
rdm_calc_engine = IRDimCalcEngine(rdm_server.CalculEngine)
calc_param = IRDimCalcParam(rdm_calc_engine.GetCalcParam())
calc_conf = rdm_calc_engine.GetCalcConf()
stream = IRDimStream(rdm_server.Connection.GetStream())
stream.Clear()
stream.WriteLong(1)
calc_param.SetObjsList(IRDimCalcParamVerifType.I_DCPVT_GROUPS_DESIGN,stream)
calc_param.SetLimitState(IRDimCalcParamLimitStateType.I_DCPLST_SERVICEABILITY,1)
stream.Clear()
stream.WriteText("all")
calc_param.SetLoadsList(stream)
rdm_calc_engine.SetCalcParam(calc_param)
rdm_calc_engine.Solve(None)
all_results = IRDimAllRes(rdm_calc_engine.Results())
grp_results = IRDimGrpRes(all_results.Get(1))
if grp_results.Check(0, IRDimGrpResCurrProf.I_DGRCP_GOVERNING):
    detailed_results = IRDimDetailedRes(grp_results.Get(0, IRDimGrpResCurrProf.I_DGRCP_GOVERNING))
    case_uy = detailed_results.GovernCaseName_uy
    uy = detailed_results.UY
    case_uz = detailed_results.GovernCaseName_uz
    uz = detailed_results.UZ
    print(case_uy)
    print(uy)
    print(case_uz)
    print(uz)
    OUT = case_uy, uy, case_uz, uz 

The problem is, all time i get the 0 in all case and displacement. It seems like the list with my load cases arent give to rigth place in Robot or somehow Robot is not “see” my list. I tried replace “all” to number of load case, for exampe “5”, but still is not working. The all code is working without any errors, but like i wrote above, it is giving all time 0.
This is the final part of my thesis, so any help would be greatly appreciated.

If you are trying to just get the Displacements for a specific load case from Robot using Dynamo. Could you consider using OOTB dynamo nodes as shown? I was able to get matching results.

I can’t do it as presented above because, I dont know id worst case combination for SLS before i run steel design. I have more than 100 combination cases for SLS in my project and i dont know which one could be the worst. But thank you for your interest in the topic.