How about a macro that builds a list of the component name, shown/hidden status, and the suppressed/resolved status for each component, and then outputs it to a text file? Copy the below and paste into a new macro.
I modified/write this a year ago. I am still learning and feel very green around the guru's here, so use at your own risk (but I haven't had any problems with it).
Later,
Ken
'******************
'Derived from:
'Traversing an Assembly (VB)
'This example illustrates how to recursively visit each component in an assembly.
'Get the current model and traverse all its components
'
'***
'Changed to visit each component (assembly and part) and write it's visiblility properties
' to a matrix, then store that to a data file as:
' 1st line: AssemblyName, ActiveConfiguration, Current/OutputMatrixLength
' All Other lines: ComponentName, Show/Hide, Suppressed/Resolved, Doc Type (Part, Assy)-->Not currently available
'
'***
' Things that don't work
' 1) Used a Matrix instead of multiple arrays. Arrays would've been better since they can be resized.
' -Program will only work for the first 100000 components. Program will work with more but *you* must manually update matrix size before running macro.
' 2) Doesn't write Assembly Configuration
' 3) Doesn't write Doc Type for components
Dim swApp As Object
Dim AssemblyDoc As Object
Dim Configuration As Object
Dim RootComponent As Object
Dim SelMgr As Object
Dim selEntity As Object
Dim selType As Long
Dim owningComponent As Object
Dim ComponentName As String
Dim void As Variant
Dim AllComponentsCurrentStateStatusMatrix(100000, 3) As Variant
'Below Needs Fixed - Change to be Dynamic Matrix Size, or count components and then declare Matrix at correct size
Dim AssemblyName, MySaveAsFilename As String
Sub main()
Set swApp = Application.SldWorks
Set AssemblyDoc = swApp.ActiveDoc
'Make sure this is an assembly
While (AssemblyDoc.GetType <> swDocASSEMBLY) 'Make sure this is an assembly
MsgBox "This macro only works for Assembly Files.", vbOKOnly + vbExclamation, "Invalid File Type"
AssemblyDoc.ClearSelection
Exit Sub
Wend
MySaveAsFilename = "C:\temp\AssemblyComponentStatus.dat"
AssemblyName = AssemblyDoc.GetTitle 'Current Assy Name
AllComponentsCurrentStateStatusMatrix(0, 0) = AssemblyName
'Find the Root Component
Set Configuration = AssemblyDoc.GetActiveConfiguration()
'Write Configuration Name to Matrix to be Verified during unhiding of components
'Below Needs Fixed
'AllComponentsCurrentStateStatusMatrix(0, 1) = AssemblyDoc.GetActiveConfiguration()
Set RootComponent = Configuration.GetRootComponent()
'Recursively traverse the component
If Not RootComponent Is Nothing Then
TraverseComponent 1, RootComponent, 1
End If
'Write Data to file
Open MySaveAsFilename For Output As #1 'Open file for output.
i = 0
While i <= AllComponentsCurrentStateStatusMatrix(0, 2)
Write #1, AllComponentsCurrentStateStatusMatrix(i, 0), AllComponentsCurrentStateStatusMatrix(i, 1), AllComponentsCurrentStateStatusMatrix(i, 2), AllComponentsCurrentStateStatusMatrix(i, 3) 'Write comma-delimited data.
i = i + 1
Wend
Close #1 'Close file.
swApp.SendMsgToUser "Component status written to: " & MySaveAsFilename
AssemblyDoc.ClearSelection
AssemblyDoc.EditRebuild
End Sub
Private Function TraverseComponent(Level As Integer, Component As Object, CurrentComponentNumber As Integer)
'Recursive routine to traverse all the children of a component
Dim text As String
Dim i As Integer
Dim Children As Variant
Dim Child As Object
Dim ChildCount As Integer
If Component.Name <> "" Then
AllComponentsCurrentStateStatusMatrix(CurrentComponentNumber, 0) = Component.Name
AllComponentsCurrentStateStatusMatrix(CurrentComponentNumber, 1) = Component.IsHidden(False) 'True=Hidden, False=Shown
AllComponentsCurrentStateStatusMatrix(CurrentComponentNumber, 2) = Component.GetSuppression
'Below Needs Fixed
'Needs FixedSuppression=0=swComponentSuppressed 'Fully suppressed - nothing is loaded
'Needs FixedSuppression=1=swComponentLightweight 'Featherweight - only graphics data is loaded
'Needs FixedSuppression=2=swComponentFullyResolved 'Fully resolved - model is completly loaded
'Below Needs Fixed
'AllComponentsCurrentStateStatusMatrix(CurrentComponentNumber, 3) = Component.GetType
'swDocNONE = 0 ' Used to be TYPE_NONE
'swDocPART = 1 ' Used to be TYPE_PART
'swDocASSEMBLY = 2 ' Used to be TYPE_ASSEMBLY
'swDocDRAWING = 3 ' Used to be TYPE_DRAWING
'swDocSDM = 4 ' Solid data manager.
CurrentComponentNumber = CurrentComponentNumber + 1
AllComponentsCurrentStateStatusMatrix(0, 2) = CurrentComponentNumber - 1
'Below Needs Fixed
'If CurrentComponentNumber = AllComponentsCurrentStateStatusMatrix(0, 2) Then
'ReDim Preserve AllComponentsCurrentStateStatusMatrix(AllComponentsCurrentStateStatusMatrix(0, 2) + MatrixLengthStep, 0)
'End If
End If
'Traverse the children
Children = Component.GetChildren ' Get the list of children
'Get the # of elements in the variant safearray. UBound returns the upper element number. Since the array begins at zero, we must add 1 to get the actual number of array elements. If no elements are in the array, then UBound returns -1.
ChildCount = UBound(Children) + 1
'For each Child in this subassembly
For i = 0 To (ChildCount - 1)
'Get Child component object
Set Child = Children(i)
'Traverse the child's components
TraverseComponent Level + 1, Child, CurrentComponentNumber
Next i
End Function