iLogic to delete suppressed compoents

Top  Previous  Next

Here's how to do it, ignoring occurrences in patterns.

 

Trace.WriteLine("   Starting....")

 

Dim oComp As ComponentOccurrence

Dim oComps As ComponentOccurrences

       

oComps = ThisDoc.Document.ComponentDefinition.Occurrences

       

For Each oComp In oComps

    If oComp.Suppressed Then

        Trace.WriteLine(oComp.Name + " is suppressed")

       

               If Not oComp.IsPatternElement Then         

               oComp.Delete

               End If 

       Else

        Trace.WriteLine(oComp.Name + " NOT suppressed")

               

       End If 

Next

 

 

Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)