API RDm engine solver error

Hi all,

I’m currently working on a script to do the steel verification using the API. Im working with this inside a python schript.
I got some good examples(excel vba) but my script won’t work. This is the error i get:


this is what is written inside the API SDK document of the steel design(written for C#)

This is how i have written it in my code:
Line 48 RDmEngine.Solve()
I guess that i’m missing the part which says ‘Nothing’ but dont know how to write it/how to add it.
This is the full code i’m using.
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
clr.AddReferenceToFileAndPath(user +r"\Dynamo\Dynamo Core\1.3\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
from RobotOM import *
from System import Object
#The inputs to this node will be stored as a list in the IN variables.
objects = IN[0]
#File = IN[1]
#Location = IN[2]
application = RobotApplicationClass()
project = application.Project
structure = project.Structure
labels = structure.Labels
application.Project.ViewMngr.Refresh()
project.CalcEngine.AnalysisParams.IgnoreWarnings = True
calcEngine = project.CalcEngine
calcEngine.AutoGenerateModel = True
calcEngine.UseStatusWindow = True
calcEngine.Calculate()
#project.SaveAs(Location+"\\"+ File +".rtd")
#project.Save()
#project.SaveAs("D:\\Werk\Robot\Dynamo files ontwikkeling\BFS-optimo learn\Modellen\test 7\Modeltest.rtd")
RDMServer = IRDimServer
RDMServer = application.Kernel.GetExtension("RDimServer")
#RDMServer = (IRDimServerMode.I_DSM_STEEL)#werkt niet
RDMServer.Mode = 1
RDmEngine = IRDimCalcEngine
RDmEngine = RDMServer.CalculEngine
#optional use it if you want to set calculation parameters by the code
RDMCalpar = IRDimCalcParam
RDMCalCnf = IRDimCalcConf
RDMCalpar = RDmEngine.GetCalcParam()
RDMCalCnf = RDmEngine.GetCalcConf()
RdmStream = IRDimStream
RdmStream = RDMServer.Connection.GetStream()
RdmStream.Clear()
RdmStream.WriteText("all")
#RDMCalpar.SetObjsList(1,RdmStream)
RDMCalpar.SetObjsList(IRDimCalcParamVerifType.I_DCPVT_MEMBERS_VERIF, RdmStream)
RDMCalpar.SetLimitState(IRDimCalcParamLimitStateType.I_DCPLST_ULTIMATE,1)
RdmStream.Clear()
RdmStream.WriteText("1to6")
RDMCalpar.SetLoadsList(RdmStream)
RDmEngine.Solve()
RdmAllResObjType = IRDimAllResObjectType
RdmAllRes = IRDimAllRes
RdmDetRes = IRDimDetailedRes
RdmAllRes = RDmEngine.Results()
RdmAllResObjType = 1
#RdmAllResObjType = RdmAllRes.ObjectsType(IRDimAllResObjectType.I_DAROT_VERIFIED_MEMBER)
#ObjCnt = RdmAllRes.ObjectsCount
RDmRetValue = IRDimMembCalcRetValue
RDmRetRes = IRDimDetailedRes
#RDmRetRes = RdmAllRes.Get(1)
#RDmRetRes = RDmEngine.Results(1)
#RdmDetRes = RdmAllRes.Get(1)
#Case = RdmDetRes.GovernCaseName
#Ratio = RdmDetRes.Ratio
#OUT = Case, Ratio
OUT = RdmAllRes
#OUT = "goed bezig"

Maybe someone of you know a solution?

All files are attached.
Calc steel design 0_03.dyn (3.8 KB)
Can’t upload my robot file for file use this link to RSAforum
Thanks in advance

Gr Edward

Hello all,

@Maciek_Kubica @jacob.small @Kibar
I hope someone of you can help me with this or tag someone who may know how to solve is?

Many thanks in advance

Gr Edward

Robot isn’t an application I know or have installed so not much I can do here. It does appear you’re using an older Dynamo build (there is a reference to 1.3) so I can recommend updating to 2.0.4 if you’re in Revit 2017-2019.

@jacob.small thanks for your reply.
I know that i reference to dynamo 1.3, that’s because i use Dynamo studio without using revit.

Ah! Upgrade to sandbox then if possible. That 1.3 version is holding you back in many ways.

@jacob.small
thanks for your reply. i will consider it.
but for now i’m still trying to find the solution for the problem with the script.

do you know other forum members who know maybe a little more on this subject?

Not offhand but I’ll see if I can find someone later today.

@jacob.small
it’s not necessary anymore. After a hint on the robot stuctural analysis forum
i changed the line with solve into:
RDmEngine.Solve(RdmStream)
Don’t know why it’s working but now i get the result i want.
Calc steel design 0_04.dyn (3.9 KB)

1 Like

Hi @1234eddie,

I’m sorry for the late response but I was on vacations and didn’t have access to email.
From the conversation above I see that you managed to solve the problem.
Feel free to contact us if you encounter further issues with steel design. Althoug personally I’m not an expert in this field I’ll be happy to connect you with the right person on the team.

Kind Regards,
Maciek

1 Like

Hello All,
Really happy to find this thread.
I am working on a similar task. I am working on a zero-touch node with C#.
After writing some hundred lines of code, I finally came to a point for verification of structural members.
I am getting a strange problem.
I have this function below (I will be adding more lines later)
private static void CreateDesignGroup()
{
IRobotApplication robApp = new RobotApplication();
IRDimServer rDimServer = robApp.Kernel.GetExtension(“RDimServer”);
rDimServer.Mode = IRDimServerMode.I_DSM_STEEL;
}
The third line causes the whole library package to disappear from the library. Although the package files are still in the folder

I know this because when I comment this line out, everything goes back to normal.
I am working from an example from the tutorial for VB

Please let me know what you need me to send some files.
Thanks

@Hadi.Moosavi

Check these links.

if you have more questions, start a new topic. if it’s full script related, dynamo forum works, but related to robot it’s better to use RSA forum.

1 Like

Thank you.
I added
using static RobotOM.RobotApplicationClass;
using static RobotOM.IRDimCalcParamVerifType;
using static RobotOM.IRDimCalcParamLimitStateType;

to the top and now I am good.