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

oke that makes more sense ;-). But even if your parameter is zero the pattern will remember the last correct value. Therefore counting the number of elements will not help you. Instead, you can check the health status of the pattern. (I discovered that you need to update your assembly before checking or it will not give a correct value.)

Also suppressing the pattern is not as easy as I would like. but anyway try this.

Dim doc As AssemblyDocument = ThisDoc.Document

doc.Update()
For Each pat As OccurrencePattern In doc.ComponentDefinition.OccurrencePatterns
    If (pat.HealthStatus <> HealthStatusEnum.kUpToDateHealth) Then
        For Each occElement As OccurrencePatternElement In pat.OccurrencePatternElements
            For Each occ As ComponentOccurrence In occElement.Occurrences
                occ.Suppress()
            Next
        Next
    End If
Next

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com