How to search for a ipart component in an assembly with a keyword using ilogic

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I tried using the code:
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences
Dim oName As String
If oOccurrence.Name.contains("family name") And oOccurrence.Name.contains("instance number") Then
oName = oOccurrence.Name
If condition Then
oOccurrence.suppress
Else
oOccurrence.unsuppress
End If
Exit For
End If
Next
this returns the name successfully only if the component is a normal part.
If it is an ipart, it returns "Nothing". How can I also get the component name for an ipart