(API) Extracting results to excel through ROS

(API) Extracting results to excel through ROS

Anonymous
Not applicable
448 Views
2 Replies
Message 1 of 3

(API) Extracting results to excel through ROS

Anonymous
Not applicable

Hey

 

I am extracting the bending moment and normal force from a model of a slab. There are around 3000 nodes so it takes quite sometime before I have the results. The process is done for the design load combinations

 

Any advice of how to speed up the process in general. My code look like this.

_____________________________________________________________________________________________________________________________

Option Explicit

Private Sub CommandButton1_Click()
CommandButton1.Caption = "Extract results"
CommandButton1.Font.Size = 10

Application.ScreenUpdating = False

Dim Robot As New RobotApplication

'Extracting all Nodes
'--------------------

Dim NodeCol As RobotNodeCollection

Set NodeCol = Robot.Project.Structure.Nodes.GetAll
Dim RNode As RobotNode
Dim ii As Integer
Dim row As Integer

row = 27

For ii = 1 To NodeCol.Count

Cells(row, 1) = "Node"
Set RNode = NodeCol.Get(ii)
Cells(row, 1) = RNode.Number
Cells(row, 4) = RNode.X
Cells(row, 5) = RNode.Y
Cells(row, 6) = RNode.Z

row = row + 1
Next ii


'CALCULATION: Command to activate calculations
'--------------------------------------------
'Robot.Project.CalcEngine.Calculate

'RESULTS - EXPORT
'----------------
Dim TheResults As RobotResultServer

Set TheResults = Robot.Project.Structure.Results

' Result parameters for panels
'------------------------------

'Dim panelcuts As RobotPanelCut

'Extracting the name of panel cuts

'InOut.Cells(22, 1) = TheResults.FiniteElems.panelcuts.GetName(1)

'Setting the result parameters
'------------------------------

Dim param As New RobotFeResultParams

' Calculation methode for reinforcement

param.CalcMethod = I_RCM_WOOD_ARMER

' Setting direction of local x

param.SetDirX I_OLXDDT_CARTESIAN, 1, 0, 0

' Layer of FE Element

param.Layer = I_FLT_MIDDLE

Dim N As Integer
Dim i As Integer
Dim j As Integer
Dim NumRows As Integer


For i = 3 To 31 Step 4

' Load case
param.Case = Workbooks("Shell Design.xlsm").Sheets("Myy-Top").Cells(24, i)

NumRows = Workbooks("Shell Design.xlsm").Sheets("Myy-Top").Cells(27, 1).End(xlDown).row

For j = 27 To NumRows

'Node
param.NODE = Workbooks("Shell Design.xlsm").Sheets("Myy-Top").Cells(j, 1)

' Structural panel
param.Panel = Workbooks("Shell Design.xlsm").Sheets("Myy-Top").Cells(12, 1)

Workbooks("Shell Design.xlsm").Sheets("Myy-Top").Cells(j, i) = TheResults.FiniteElems.Complex(param).MYY_TOP / 1000

Workbooks("Shell Design.xlsm").Sheets("Myy-Top").Cells(j, i + 1) = TheResults.FiniteElems.Detailed(param).NYY / -1000 ' The - is to turn compression to positive for the use in the design shhet

Next j

Next i

Application.ScreenUpdating = True

End Sub
______________________________________________________________________________________________________________________________

 

Thanks in advance.

0 Likes
449 Views
2 Replies
Replies (2)
Message 2 of 3

Rafal.Gaweda
Autodesk Support
Autodesk Support

I am not sure if i helps but you may try:

 

'somewhere at the beginning of function
Robot.Interactive = 0
......
Dim TheResults As RobotResultServer
Set TheResults = Robot.Project.Structure.Results
Dim FER As RobotFeResultServer
Set FER = TheResults.FiniteElems

'then use FER.Complex... FER.Detailed...

'at the end of function
Robot.Interactive = 1

 



Rafal Gaweda
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks, this helps a bit.

0 Likes