Dim oAsmDoc As AssemblyDocument
oAsmDoc= ThisApplication.ActiveDocument
Dim oAsmDef As AssemblyComponentDefinition
oAsmDef = oAsmDoc.ComponentDefinition
Dim oLeafOccs As ComponentOccurrencesEnumerator
oLeafOccs = oAsmDef.Occurrences.AllLeafOccurrences
Dim oOcc As ComponentOccurrence
For Each oOcc In oLeafOccs
If oOcc.Visible = True Then
oOcc.Visible = False
End If
Next