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 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
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.
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.
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
Thank you.
I added
using static RobotOM.RobotApplicationClass;
using static RobotOM.IRDimCalcParamVerifType;
using static RobotOM.IRDimCalcParamLimitStateType;