Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 3
samuel.pereira
974 Views, 2 Replies

ROBOT API - RATIO

Hello,

 

I'm trying to retrieve CodeResults RATIO using Robot steel API, for example from bar number 1. My code (at the failure lines) goes like this:

 

Sub RATIO()

    Dim RobApp As New RobotApplication

    Dim RDmEngine As IRDimCalcEngine

    Set RDmEngine = RDmEngineServer.CalculEngine

  

    Dim RDmRetValue As IRDimMembCalcRetValue

    Dim RDmDetRes As IRDimDetailedRes

    Set RDmDetRes = RdmAllRes.Get(1)

   

    RDmRetValue = RDmDetRes.RATIO

   

    Cells(1, 1) = RDmRetValue

 

End Sub

 

I have seen the document "Robot API SteelDesign" but it not return the ratio. What am I doing wrong? It can provide a complete example to "Visual Basic -MIcrosoft Excel"?

 

Thanks

2 REPLIES 2
Message 2 of 3

Sub Ratio()

 

Dim RobApp As RobotApplication
Set RobApp = New RobotApplication

Dim RDMServer As IRDimServer
Set RDMServer = RobApp.Kernel.GetExtension("RDimServer")
RDMServer.Mode = I_DSM_STEEL

Dim RDmEngine As IRDimCalcEngine
Set RDmEngine = RDMServer.CalculEngine

'the part below is optional, use it if you want to set calculation parameters by the code

Dim RDmCalPar As IRDimCalcParam
Dim RDmCalCnf As IRDimCalcConf

Set RDmCalPar = RDmEngine.GetCalcParam
Set RDmCalCnf = RDmEngine.GetCalcConf

 

Dim RdmStream As IRDimStream 'Data stream for setting parameters
Set RdmStream = RDMServer.Connection.GetStream
RdmStream.Clear

 

'Calculate results for all sections
RdmStream.WriteText ("all") ' member(s) selection
RDmCalPar.SetObjsList I_DCPVT_MEMBERS_VERIF, RdmStream 'members verification
RDmCalPar.SetLimitState I_DCPLST_ULTIMATE, 1 'Set Limit State
RdmStream.Clear
RdmStream.WriteText ("1") 'Set Load Case(s)
RDmCalPar.SetLoadsList RdmStream

RDmEngine.SetCalcConf RDmCalCnf
RDmEngine.SetCalcParam RDmCalPar


'end of calclulation parameter settings

RDmEngine.Solve Nothing

 

Dim RDmDetRes As IRDimDetailedRes
Dim RDMAllRes As IRDimAllRes

 

Set RDMAllRes = RDmEngine.Results
Set RDmDetRes = RDMAllRes.Get(1)

Cells(1, 1) = RDmDetRes.RATIO

 

End Sub



Rafal Gaweda
Message 3 of 3

Very useful! Thank you very much!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report