Discussion Groups

Robot Structural Analysis

Reply
Active Contributor
samuel.pereira
Posts: 28
Registered: ‎01-02-2012

ROBOT API - RATIO

307 Views, 2 Replies
01-02-2012 10:45 AM

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

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,055
Registered: ‎04-26-2010

Re: ROBOT API - RATIO

01-03-2012 03:36 AM in reply to: samuel.pereira

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
Please use plain text.
Active Contributor
samuel.pereira
Posts: 28
Registered: ‎01-02-2012

Re: ROBOT API - RATIO

01-03-2012 04:20 AM in reply to: samuel.pereira

Very useful! Thank you very much!

Please use plain text.