I have the below code in order to get the name (including the instance ID) of the components of an assembly!
It's working well. However, it doesn't have any order to get the components of the assembly!!
For example, It be great if the first gotten compoent would be the first component of the feature manager.
Does anybody know how to get this information in a organized way or even how this custon logic works?
Dim swApp As SldWorks.SldWorks
Dim Ass As SldWorks.AssemblyDoc
Dim Comp As Variant
Dim swComp As Component2
Set swApp = Application.SldWorks
Set Ass = swApp.ActiveDoc
Comp = Ass.GetComponents(True)
For i = 0 To UBound(Comp)
Set swComp = Comp(i)
Take a look at this example: http://help.solidworks.com/2014/English/api/sldworksapi/traverse_assembly_at_component_and_feature_levels_using_recursion_example_vb.htm
Retrieving data ...