AnsweredAssumed Answered

GetComponents is the best way for get an Array of Components?

Question asked by roberto gennari on Sep 8, 2015
Latest reply on Jul 12, 2019 by Josh Brady


I use GetComponets to retrieve the array of components in an assembly, and then make use that I need, but overall it is very very slow:

This is my code in Visual Basic 2010, in stand alone metod


swApp = CreateObject("SldWorks.Application")


swModel = swApp.ActiveDoc


Part = swModel


Dim i As Integer


comps = Part.GetComponents(False)

For i = 0 To UBound(comps)

comp = comps(i)

   If comp.IsRoot Then 




  End If



Is there a faster way to get my array of components?



Thank you