Hello Rafal,
I'm using the following code:
'_____________
Dim Res As IRobotResultQueryReturnType
Dim RobResQueryParams As RobotResultQueryParams
Dim RobResRowSet As New RobotResultRowSet
Dim RSelection As RobotSelection
RSelection = robotapp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_PANEL)
RSelection.FromText(elem)
Dim RSelectioncase As RobotSelection
RSelectioncase = robotapp.Project.Structure.Selections.Create(IRobotObjectType.I_OT_CASE)
RSelectioncase.FromText(Convert.ToString(caso))
Dim FileLines As String
FileLines = ""
FileLines = "Panel,Node,Case,UXX (cm),UYY (cm),WNorm. (cm),RXX (Deg),RYY (Deg)" & vbCrLf
RobResQueryParams = robotapp.CmpntFactory.Create(IRobotComponentType.I_CT_RESULT_QUERY_PARAMS)
RobResQueryParams.ResultIds.SetSize(5)
RobResQueryParams.Selection.Set(IRobotObjectType.I_OT_PANEL, RSelection)
RobResQueryParams.Selection.Set(IRobotObjectType.I_OT_CASE, RSelectioncase)
RobResQueryParams.SetParam(IRobotResultParamType.I_RPT_MAX_BUFFER_SIZE, 2000000)
RobResQueryParams.SetParam(IRobotResultParamType.I_RPT_SMOOTHING, IRobotFeResultSmoothing.I_FRS_GLOBAL_SMOOTHING)
If combolayer.SelectedIndex = 0 Then
RobResQueryParams.SetParam(IRobotResultParamType.I_RPT_LAYER, IRobotFeLayerType.I_FLT_UPPER)
ElseIf combolayer.SelectedIndex = 1 Then
RobResQueryParams.SetParam(IRobotResultParamType.I_RPT_LAYER, IRobotFeLayerType.I_FLT_MIDDLE)
ElseIf combolayer.SelectedIndex = 2 Then
RobResQueryParams.SetParam(IRobotResultParamType.I_RPT_LAYER, IRobotFeLayerType.I_FLT_LOWER)
Else
End If
RobResQueryParams.SetParam(IRobotResultParamType.I_RPT_DIR_X_DEFTYPE, IRobotObjLocalXDirDefinitionType.I_OLXDDT_UNDEFINED)
'RobResQueryParams.SetParam(I_RPT_DIR_X, 1, 0, 0)
RobResQueryParams.ResultIds.Set(1, IRobotFeResultType.I_FRT_DETAILED_UXX)
RobResQueryParams.ResultIds.Set(2, IRobotFeResultType.I_FRT_DETAILED_UYY)
RobResQueryParams.ResultIds.Set(3, IRobotFeResultType.I_FRT_DETAILED_WNORM)
RobResQueryParams.ResultIds.Set(4, IRobotFeResultType.I_FRT_DETAILED_RXX)
RobResQueryParams.ResultIds.Set(5, IRobotFeResultType.I_FRT_DETAILED_RYY)
Res = robotapp.Project.Structure.Results.Query(RobResQueryParams, RobResRowSet)
Do While Res = IRobotResultQueryReturnType.I_RQRT_MORE_AVAILABLE
Dim ok As Boolean
ok = RobResRowSet.MoveFirst()
While ok
FileLines = FileLines & Format(RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(1)) * 100, "0.000") & ","
FileLines = FileLines & Format(RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(2)) * 100, "0.000") & ","
FileLines = FileLines & Format(RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(3)) * 100, "0.000") & ","
FileLines = FileLines & Format(RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(4)) * (180 / Math.PI), "0.000") & ","
FileLines = FileLines & Format(RobResRowSet.CurrentRow.GetValue(RobResRowSet.ResultIds.Get(5)) * (180 / Math.PI), "0.000") & vbCrLf
ok = RobResRowSet.MoveNext()
End While
Res = robotapp.Project.Structure.Results.Query(RobResQueryParams, RobResRowSet)
Loop
'_____________
It seems to be working fine, because "FileLines" captures some results, but at some point within "While ok" loop a COM exception crashes the procees with HRESULT E_FAIL error. Any ideas?
Regards,