I have tried your code and tailred it to my requirement. I am getting following error.
My full code :
Public Sub GetPanelProperties2()
'To check robot is open
Set robapp = New RobotApplication
If Not robapp.Project.IsActive Or robapp.Project.Type <> I_PT_SHELL Then
MsgBox "Open Robot Model", vbExclamation
Exit Sub
End If
robapp.Visible = True
robapp.Interactive = 1
robapp.UserControl = True
'Get the all the panel properties from robot function
Dim ThkSrv As RobotLabelServer
Set ThkSrv = robapp.Project.Structure.Labels
' Get the number of panel properties
Dim ThkNames As IRobotNamesArray
Set ThkNames = ThkSrv.GetAvailableNames(I_LT_PANEL_THICKNESS)
Thkcount = ThkNames.count
Dim ThkName As String, MatName As String, t1 As Double, t2 As Double, t3 As Double
Dim THData As RobotThicknessData
Dim HomoThickData As RobotThicknessHomoData
For i = 1 To Thkcount
Dim Name As String
Set Name = ThkNames.Get(K)
Cells(i + 2, 1) = ThkSrv.GetLabel(I_LT_PANEL_THICKNESS).Name
Set THData = Obj.GetLabel(I_LT_PANEL_THICKNESS).Data
Cells(i + 2, 2) = THData.MaterialName
If (THData.ThicknessType = I_TT_HOMOGENEOUS) Then
Set HomoThickData = THData.Data
Select Case HomoThickData.Type
Case I_THT_CONSTANT
Cells(i + 2, 3) = HomoThickData.ThickConst
Case I_THT_VARIABLE_ALONG_LINE
With HomoThickData
Cells(i + 2, 3) = .Thick1
Cells(i + 2, 4) = .Thick2
End With
Case I_THT_VARIABLE_ON_PLANE
With HomoThickData
Cells(i + 2, 3) = .Thick1
Cells(i + 2, 4) = .Thick2
Cells(i + 2, 5) = .Thick3
End With
End Select
End If
Next i
End Sub
My Intention is to get panel propteries and then change them and update the same in the robot.