AnsweredAssumed Answered

Add Components to an Array

Question asked by Alice Caspari on Dec 4, 2014
Latest reply on Dec 4, 2014 by Daniel Andersson

I am missing something here...

My array does not populate with values, any help would be appreciated.



Option Explicit

Dim swApp As SldWorks.SldWorks

Dim Assy As SldWorks.AssemblyDoc

Dim Component As Variant

Dim swComponent As Component2

Dim i As Long

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

Sub main()

    Set swApp = Application.SldWorks
     Set Assy = swApp.ActiveDoc
    Component = Assy.GetComponents(True)
    For i = 0 To UBound(Component)

boolstatus = Component(i).ExcludeFromBOM
If Not boolstatus Then

    Set swComponent = Component(i)       
    End If
End Sub