Here is my method. It isn't perfect, but fast enough I think. I use Alt+V to Hide Parts or Components (Sub Assemblies) and "V" to to bring them all back in view. This is by way of an External iLogic rule. This works on Inventor 2024, when external rules can be accessed in Tools -> Customize -> Keyboard for shortcuts, an amazing feature!
In Tools -> Customize -> Keyboard I use:
- Press 1: Part Priority (this is so I can quickly select between parts or subassemblies, for viewing editing etc.)
- Press 2: Component Priority (if you want to hide a subassemby)
- press V: Set component visibility (this is the external iLogic rule)


Here is the external rule. It refreshes the view representation and relies on "Default" View to exist. It may have to be adjusted if you have View Representations labeled differently. If you're working in an Assembly it sets all components to Visible, but hides "Referenced" components. If you're working on a Part, it calls a second rule "Set Surface Visibility", which is the second code I attached here. Please make sure the path of "Set Surface Visibility" is defined correctly.
I hope it helps. If you don't have any experience with iLogic it may be daunting, but you can do sooo much with iLogic, I think it's worth learning the basics at least!
'https://forums.autodesk.com/t5/inventor-forum/ilogic-rule-to-find-all-reference-parts-and-turn-off-visibilty/td-p/4305340
Sub Main()
If ThisApplication.ActiveDocumentType = DocumentTypeEnum.kPartDocumentObject Then
PartSurfaces
Exit Sub
ElseIf ThisApplication.ActiveDocumentType = DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("Eh, the rule '" & iLogicVb.RuleName & "doesn't work in Drawings", vbOKOnly, "WRONG DOCUMENT TYPE")
Exit Sub
End If
Dim oDoc As Document
oDoc = ThisDoc.Document
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oDoc.ComponentDefinition
oAssemblyComponents = oAsmCompDef.Occurrences
oViewRepsCollection = oAsmCompDef.RepresentationsManager.DesignViewRepresentations
oActiveViewRep = oAsmCompDef.RepresentationsManager.ActiveDesignViewRepresentation
Dim oAVR As String = oActiveViewRep.Name
'msgbox(oAVR)
Dim oOccurrence As ComponentOccurrence
Dim oViewRep As DesignViewRepresentation
For Each oViewRep In oViewRepsCollection
oViewRep.Activate
'MsgBox(oViewRep.Name)
Try
'Activate a writeable View Rep (master view rep is not writeable)
oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("Default").Activate
Catch
'Assume error means this View Rep does not exist, so create it
oViewRep = oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add("Default")
End Try
If oViewRep.Name.Contains("Default") Then
'If oViewRep.Name = "Default" Then
oViewRep.Activate
For Each oOccurrence In oAssemblyComponents
If (oOccurrence.BOMStructure = BOMStructureEnum.kReferenceBOMStructure) Then
oOccurrence.Visible = False
Else
Try
oOccurrence.Visible = True
Catch
End Try
End If
Next
Else
'Do nothing
End If
Next
'oOccurrence.SetDesignViewRepresentation("Default",, True)
'oViewRep.DesignViewRepresentation("Default",, True)
'oActiveViewRep.Activate 'Sets the view rep back to the one that was active before the rule was executed
Representations 'call Representations Sub
End Sub
Sub Representations()
Dim doc As AssemblyDocument = ThisDoc.Document
Dim oAsmCompDef As ComponentDefinition
oAsmCompDef = doc.ComponentDefinition
Dim oCompOcc As Inventor.ComponentOccurrence
For Each oCompOcc In oAsmCompDef.Occurrences
If oCompOcc.Visible = True Then
Try
oCompOcc.SetDesignViewRepresentation("Default", True)
Catch
End Try
End If
'On Error Resume Next
Next
End Sub
Sub PartSurfaces()
Dim oDoc As Document = ThisDoc.Document
auto = iLogicVb.Automation
'Define location of iLogic rule "Set Surface Visibility"
auto.RunExternalRule(oDoc, "C:\Autodesk Inventor\Ilogic\Appearance - View Representations\Set Surface Visibility")
End Sub
Rule: "Set Surface Visibility"
Sub Main()
'catch and skip errors
On Error Resume Next
Dim Vis As Boolean
Dim result = MessageBox.Show("Yes" & vbCrLf & "No - Turn Visibility OFF" & vbCrLf & _
"Cancel - Exit", "Make all surfaces visible?", MessageBoxButtons.YesNoCancel)
Select Case result
Case vbYes
Vis = True
Case vbNo
Vis = False
Case vbCancel
Exit Sub
End Select
'define the active assembly
Dim oAssyDoc As AssemblyDocument
oAssyDoc = ThisApplication.ActiveDocument
Dim oDoc As Inventor.Document = ThisApplication.ActiveDocument
DocType = oDoc.DocumentType
Dim oSurfacebody As WorkSurface
If DocType = DocumentTypeEnum.kAssemblyDocumentObject Then
For Each oDoc In oAssyDoc.AllReferencedDocuments
For Each oSurfacebody In oDoc.ComponentDefinition.WorkSurfaces
oSurfacebody.Visible = Vis
Next
Next
Else
For Each oSurfacebody In oDoc.ComponentDefinition.WorkSurfaces
oSurfacebody.Visible = Vis
Next
End If
ThisApplication.ActiveDocument.Update
End Sub