Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
dalton98
in reply to: duans5FLJC

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