Export Critical Temperatures

Export Critical Temperatures

paul.bassLH
Advocate Advocate
878 Views
8 Replies
Message 1 of 9

Export Critical Temperatures

paul.bassLH
Advocate
Advocate

Hi everybody

I'm trying to export critical temperatures after a fire analysis for each beam of my project.

I have read old discussions on this subject and try different available codes. But i still have a problem with first lines of the code:

 

 Public Sub GetCriticalTemp()
        Dim Robapp As RobotApplication
        Set Robapp = New RobotApplication
        
        Dim RDMServer As IRDimServer
        Set RDMServer = Robapp.Kernel.GetExtension("RDimServer")
...

I have an error on the last line: "type mismatch"

It is a cut/copy of the code find here (i just add "Set", otherwise i got the error "object variable or block variable 'with' not defined")

https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-coderesults-e32-4/m-p/5505061#M30... 

 

I try with:

Set RDMServer = Robapp.Kernel.GetExtension("RDimServer")

 error: type mismatch

and with

Set RDMServer = Robapp.Kernel.GetExtension("RDMServer")

 error: method 'getextension' of the object 'IRobotKernel' failed

 

I add "Robot Object Model ver 21.0" and "Robot Object Model ver 21.0".

I don't understand where is my mistake. 

Could someone help me please to start my code ?

Thanks

0 Likes
Accepted solutions (2)
879 Views
8 Replies
Replies (8)
Message 2 of 9

Stephane.kapetanovic
Mentor
Mentor

hi @paul.bassLH 

the first lines look correct

have you tried restarting Robot and VBE?

Did you add "Robot Object Model ver. xx.x" in references ?

Best regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
0 Likes
Message 3 of 9

paul.bassLH
Advocate
Advocate

Hi Stephane and thanks (on more time) for your answer.

Yes, i tried to restart, the entier computer but always the same problem.

I already added "Robot Object Model ver. 21.0" and "Robot Kernel Object Model ver. 21.0" in references .

I just removed "Robot Kernel Object Model ver. 21.0" and now it works...

 

 

0 Likes
Message 4 of 9

Stephane.kapetanovic
Mentor
Mentor

Ok so now it works !

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
0 Likes
Message 5 of 9

kmmdD66ZQ
Contributor
Contributor

Hi @paul.bassLH and @Stephane.kapetanovic.

I am working in version 2025 and having the same issue at line 6 of your code.

 

Could you please provide a code snippet of getting the temperatures with VBA. (I suspect you are using this)

 

I have also looked through old forum post and also tried the code in this link:
https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-coderesults-e32-4/m-p/5505061#M30...
but it still does not work.

 

Thanks in advance.

0 Likes
Message 6 of 9

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

hi @kmmdD66ZQ 

Here is a code snippet adapted from VB to VBA syntax.

Public Sub TryGetCriticalTempForum()
  Dim RobApp As RobotApplication:   Set RobApp = New RobotApplication
  Dim RDmObjLst As RobotSelection:  Set RDmObjLst = RobApp.Project.Structure.Selections.Create(I_OT_BAR)
  Dim RDmServer As IRDimServer:     Set RDmServer = RobApp.Project.DimServer:       RDmServer.Mode = I_DSM_STEEL
  Dim RDmStream As IRDimStream:     Set RDmStream = RDmServer.Connection.GetStream: RDmStream.Clear
  Dim RDmEngine As IRDimCalcEngine: Set RDmEngine = RDmServer.CalculEngine
  Dim RDmCalPar As IRDimCalcParam:  Set RDmCalPar = RDmEngine.GetCalcParam
  Dim RDmCalCnf As IRDimCalcConf:   Set RDmCalCnf = RDmEngine.GetCalcConf
  
  RDmObjLst.FromText "1to3"
  RDmStream.WriteText " ": RDmCalPar.SetObjsList I_DCPVT_MEMBERS_VERIF, RDmStream: RDmStream.Clear
  RDmStream.WriteText "3": RDmCalPar.SetLoadsList RDmStream:                       RDmStream.Clear
  RDmCalPar.SetLimitState I_DCPLST_ULTIMATE, 1: RDmCalCnf.SetFlag I_DCCFT_FIRE, 1
  RDmEngine.SetCalcParam RDmCalPar: RDmEngine.SetCalcConf RDmCalCnf: RDmEngine.Solve Nothing
  
  Dim allRes As IRDimAllRes, detRes As IRDimDetailedRes, result As Object, res As Object
  Dim e1 As IRDimCodeResE32_1, e2 As IRDimCodeResE32_2, e3 As IRDimCodeResE32_3, e4 As IRDimCodeResE32_4
  
  Set allRes = RDmEngine.Results
  For i = 0 To allRes.ObjectsCount - 1: UsrNo = allRes.ObjectUsrNo(i): If Not RDmObjLst.Contains(UsrNo) Then GoTo NextMember
    Set result = allRes.Get(UsrNo)
    If TypeOf result Is IRDimDetailedRes Then
      Set detRes = result
      With detRes: Set res = .CodeResults: Debug.Print "Bar n°: " & .MemberUsrNo & " Ratio: " & FormatNumber(.Ratio, 2) & " " & .GovernCaseName: End With
      If TypeOf res Is IRDimCodeResE32_1 Then Set e1 = res: Debug.Print "ClassOfSect: " & e1.ClassOfSect
      If TypeOf res Is IRDimCodeResE32_2 Then Set e2 = res: Debug.Print "BuckCurveY:  " & e2.BuckCurveY
      If TypeOf res Is IRDimCodeResE32_3 Then Set e3 = res: Debug.Print "LatBuckKfl:  " & e3.LatBuckParamKfl
      If TypeOf res Is IRDimCodeResE32_4 Then Set e4 = res: Debug.Print "FireMaxTemp: " & FormatNumber(e4.FireMaxMembSurfaceTempOA, 1)
    End If
NextMember:
  Next
End Sub

Best Regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
0 Likes
Message 7 of 9

kmmdD66ZQ
Contributor
Contributor

Hi @Stephane.kapetanovic 

 

Thanks for the quick response that worked great.

I notet that this code provide me with the "FireMaxTemp" I am looking to get the "FireCritTemp" or as I remember it mentioned in Robot O,a,Cr.
I looked through the API in the "Locals" window in VBA but i can't seem to find "O,a,Cr"

 

Can this temperaturer be extracted directly?

 

Thanks in advance.

 

Best regards.

0 Likes
Message 8 of 9

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

hi @kmmdD66ZQ 

To verify if a variable exists, you must examine the properties of the IRDimCodeResE32_4 class. Use the Local Variables window in the VBA editor to check whether the corresponding property in e4 returns a value.

See also : What are the differences between the three available methods for Eurocode for Fire stability check a..., API Fire analysis - Verification methodHow to run a steel design with fire analysis for Eurocode based codes in Robot Structural Analysis

To keep discussions clear and helpful for everyone, please avoid asking multiple unrelated questions in the same thread. For more general questions about Eurocode justifications, feel free to create a new topic.

Best Regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
Message 9 of 9

kmmdD66ZQ
Contributor
Contributor

Sorry I didn't realize that is was a class.

 

I found it.

Thanks-