03-28-2023
05:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-28-2023
05:48 AM
Hello. You would need to loop through each occurrence in the pattern. Heres an example
Dim oADoc As AssemblyDocument = ThisDoc.Document Dim oOccPat As OccurrencePattern For Each oOccPat In oADoc.ComponentDefinition.OccurrencePatterns 'top level patterns
Dim oOccPatEle As OccurrencePatternElement For Each oOccPatEle In oOccPat.OccurrencePatternElements 'pattern elements
Dim oOcc As ComponentOccurrence For Each oOcc In oOccPatEle.Occurrences 'element components 'If criteria met 'if parent pattern is not top level pattern If Not oOcc.PatternElement.Parent Is oOccPat oOcc.PatternElement.Parent.Suppress Else oOcc.Suppress End If 'End If Next Next Next