For this line (swChildComp.GetType = swDocPART) I am getting the following error.
Operator '=' is not defined for types 'System.Type' and 'Integer'.
In my program I have tried everything. Here is what I have so far:
VB.NET CODE
Public Class Editor
Public Enum swDocumentTypes_e
swDocNONE = 0 ' Used to be TYPE_NONE
swDocPART = 1 ' Used to be TYPE_PART
swDocASSEMBLY = 2 ' Used to be TYPE_ASSEMBLY
swDocDRAWING = 3 ' Used to be TYPE_DRAWING
End Enum
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swAssy As SldWorks.AssemblyDoc
Dim swConf As SldWorks.Configuration
Dim swRootComp As SldWorks.Component2
Dim bRet As Boolean
Dim swChildComp As SldWorks.Component2
Dim swCompConfig As SldWorks.Configuration
Dim sPadStr As String
Dim mo As Integer
Dim ModDoc As Object
Sub TraverseComponent(ByVal swComp As SldWorks.Component2, ByVal
nLevel As Long)
Dim vChildCompArr As Object
Dim vChildComp As Object
Dim swChildComp As SldWorks.Component2
Dim SupState As Long
ProgramStatus.Text = "Adding Components"
StatusStrip1.Refresh()
vChildCompArr = swComp.GetChildren
For Each vChildComp In vChildCompArr
swChildComp = vChildComp
ModDoc = swChildComp.GetModelDoc
SupState = swChildComp.GetSuppression
If (swChildComp.GetType = swDocASSEMBLY) then 'Process Assemblies
'Do Something Here
End If
If (swChildComp.GetType = swDocPART) then 'Process Parts Only
'Do Something Else Here
End If
DataGridView1.Refresh()
TraverseComponent(swChildComp, nLevel + 1)
Next
End Sub
End Class