Assembly Ballons - How does it number them?
Assembly Ballons - How does it number them?
(OP)
When ballooning an assembly, it seems SW balloons them in the order they were inserted into the assembly, starting from 1.
Is this info stored anywhere? How does it know what was inserted first?
It probably just goes down the feature tree, and assigns an incremental value for each unique part. Is this correct?
I am trying to link the balloon number with an external db, and haven't quite grasped how to do it.
Any thoughts or comments would be appreciated.
Is this info stored anywhere? How does it know what was inserted first?
It probably just goes down the feature tree, and assigns an incremental value for each unique part. Is this correct?
I am trying to link the balloon number with an external db, and haven't quite grasped how to do it.
Any thoughts or comments would be appreciated.
phreaq
Has anyone seen my brain today? (^_^)
www.phreaq.net






RE: Assembly Ballons - How does it number them?
RE: Assembly Ballons - How does it number them?
SW06 SP5.0
Flores
RE: Assembly Ballons - How does it number them?
CODE
Dim swModel As Object
Dim swComponent As Object
Dim swChild As Object
Dim Children As Variant
Dim Child As Variant
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swComponent = swModel.GetActiveConfiguration.GetRootComponent
Children = swComponent.GetChildren
For Each Child In Children
Set swChild = Child
Debug.Print swChild.Name2
Next
End Sub
1) Create a simple assembly of three parts.
2) Run the macro (the immediate window must be displayed in order to see the output; press ctrl+g to display it).
3) Note the order of the components.
No, it is more complicated than that as I will demostrate.
1) In the 3 part assembly you created, re-arrange the components in the Feature Manager Tree to a different order.
2) Run the macro.
3) Note the component order. It is the same as the first time the macro was run. This is why (I believe) you sometimes must go into the table properties of a BOM and click the follow assembly order button.
To actually see the order change, you must modify the macro as shown in green.
CODE
Dim swModel As Object
Dim swComponent As Object
Dim swChild As Object
Dim swFeature As Object
Dim Children As Variant
Dim Child As Variant
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swComponent = swModel.GetActiveConfiguration.GetRootComponent
Children = swComponent.GetChildren
For Each Child In Children
Set swChild = Child
Debug.Print swChild.Name2
Next
Debug.Print
Set swFeature = swModel.FirstFeature
Do Until swFeature Is Nothing
Debug.Print swFeature.Name
Set swFeature = swFeature.GetNextFeature
Loop
End Sub
Sorry, cannot help you here, I do not understand what you are trying to do
I will not comment on your last question.
SA
RE: Assembly Ballons - How does it number them?
SolidAir, thanks for your efforts, it should help with what I need :D
and thanks for the refrain on all my comments ;)
phreaq
Has anyone seen my brain today? (^_^)
www.phreaq.net