Here is an iLogic rule that will iterate down through all levels of the assembly, and add all of the sheet metal components to a HighlightSet of the main assembly. I set the color of the set to Red, just as an example. I am not sure which of the parts which are not currently sheet metal parts may need to be converted into sheet metal parts though. But that conversion is relatively simple to do by code too, if needed.
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
MsgBox("An Assembly Document must be active for this rule to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oOccs As ComponentOccurrences = oADoc.ComponentDefinition.Occurrences
If oOccs.Count = 0 Then Exit Sub
oHLS = oADoc.CreateHighlightSet
oHLS.Color = ThisApplication.TransientObjects.CreateColor(255, 0, 0) 'Red
RecurseComponents(oOccs)
End Sub
Dim oHLS As Inventor.HighlightSet
Sub RecurseComponents(oComps As ComponentOccurrences)
If oComps Is Nothing OrElse oComps.Count = 0 Then Exit Sub
For Each oComp As ComponentOccurrence In oComps
If oComp.Suppressed Then Continue For
If TypeOf oComp.Definition Is SheetMetalComponentDefinition Then
oHLS.AddItem(oComp)
End If
If oComp.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
RecurseComponents(oComp.SubOccurrences)
End If
Next
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)