Message 1 of 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
We are currently upgrading our scripts from IronPhyton 2 to CPhyton 3.
I am trying to get the calculations of steel in Robot with Dynamo, CPython3 version. I want to achieve a result like the figure shows.
But I get the following AttributeError : type object 'RDimServer' has no attribute 'IRDimCalcEngine' [' File "<string>", line 36, in <module>\n'].
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
sys.path.append(user+r"\Dynamo\Dynamo Core\2.11\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.d11")
clr.AddReference('interop.RobotOM')
#clr.AddReference(user+r"\Dynamo\Dynamo Core\2.11\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
RDmEngine2 = RDimServer.IRDimCalcEngine
#optional use it if you want to set calculation parameters by the code
RDMCalpar = IRDimCalcParam
RDMCalCnf = IRDimCalcConf
RDMCalpar = RDmEngine.GetCalcParam()
RDMCalCnf = RDimEngine.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("1to7")
RDMCalpar.SetLoadsList(RdmStream)
RDmEngine.Solve(RdmStream)
#RDmEngine.Solve(None)
RdmAllResObjType = IRDimAllResObjectType
RdmAllRes = IRDimAllRes
#RdmDetRes = IRDimDetailedRes
RdmAllRes = RDmEngine.Results()
RdmAllResObjType = 1
#RdmAllResObjType = RdmAllRes.ObjectsType(IRDimAllResObjectType.I_DAROT_VERIFIED_MEMBER)
ObjCnt = RdmAllRes.ObjectsCount
RDmRetValue = IRDimMembCalcRetValue
RDmDetRes = IRDimDetailedRes
RDmDetRes = RdmAllRes.Get("1")
#RDmRetRes = RDmEngine.Results(1)
#RdmDetRes = RdmAllRes.Get(1)
Case = RDmDetRes.GovernCaseName
Ratio = RDmDetRes.Ratio
RdmCodeRes = object
RdmCodeRes = RDmDetRes.CodeResults
Nbyrd = RdmCodeRes.BuckStrenNbyrd
#OUT =
OUT = RdmAllRes, RdmStream, Case, Ratio, Nbyrd
#OUT = "goed bezig"
Could you help me to review what is wrong with the code?
Thank you in advance.
Best Regard,
Stefany
Solved! Go to Solution.