Hi,
This should do the trick, it's written quick and dirty, sorry for that
Sub HideAllSelectedOccurences()
Dim oCommandMgr As CommandManager
Set oCommandMgr = ThisApplication.CommandManager
Dim oAsmDoc As AssemblyDocument
Set oAsmDoc = ThisApplication.ActiveDocument
Dim oAsmDef As AssemblyComponentDefinition
Set oAsmDef = oAsmDoc.ComponentDefinition
Dim oOcc As ComponentOccurrence
Set oOcc = oCommandMgr.Pick(kAssemblyLeafOccurrenceFilter, "Pick occurrence to hide")
Dim strFileName As String
strFileName = oOcc.ReferencedDocumentDescriptor.FullDocumentName
Dim oLeafOccs As ComponentOccurrencesEnumerator
Set oLeafOccs = oAsmDef.Occurrences.AllLeafOccurrences
Dim oOcc1 As ComponentOccurrence
On Error Resume Next
For Each oOcc1 In oLeafOccs
If oOcc1.ReferencedDocumentDescriptor.FullDocumentName = strFileName Then
oOcc1.Visible = False
End If
Next oOcc1
End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"