Referenced Configuration of Top level Components in Assembly
Dim swApp As SldWorks.SldWorks
Dim swAssy As SldWorks.AssemblyDoc
Dim swSelMgr As SldWorks.SelectionMgr
Dim swModel As SldWorks.ModelDoc
Dim swComp As SldWorks.Component
Dim RefCfg As String
Dim vcomp As Variant
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swAssy = swModel
vcomp = swAssy.GetComponents(True)
'Set swSelMgr = swModel.SelectionManager
For i = 0 To UBound(vcomp)
Set swComp = vcomp(i)
' Change component configuration to "in-use"
'swComp.ReferencedConfiguration = ""
RefCfg = swComp.ReferencedConfiguration
MsgBox.Show swComp.Name2 & "-" & "Referenced configuration: " & RefCfg
Next
' For changes to take effect
swModel.EditRebuild3
End Sub
Comments
Post a Comment