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: WCrihfield

@WCrihfield Your are absolute right. (This is not the first time I do this wrong....) the code should look more like this:

Sub Main()
    Dim doc = ThisDoc.Document
    res(ThisDoc.Document)
    doc.Update2()
End Sub

Sub res(doc As Document)
    If (doc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject) Then Return

    Dim aDoc As AssemblyDocument = doc
    If (aDoc.ComponentDefinition.IsModelStateMember) Then
        aDoc = aDoc.ComponentDefinition.FactoryDocument
    End If

    Dim occs As ComponentOccurrences = aDoc.ComponentDefinition.Occurrences

    For Each occ As ComponentOccurrence In occs
        occ.Unsuppress()
        res(occ.Definition.Document)
    Next
End Sub

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