Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
shiftctrl.io
662 Views, 3 Replies

How to Undo Checkout of All (Inventor) Suppressed Components

Hi All,

 

I posted the following question on the Inventor Customization forum, though haven't received a response, so wondering if this is the right place to ask. 

 

Below is a method in a C# application which will delete all suppressed occurrences from an assembly, however I need to add some logic to first undo checkout of the suppressed components prior to the delete operation.

 

Any suggestions?

 

public static void DeleteSuppressedOccurrences(Document document)
{
    if ((int)document.DocumentType != Enum.AssemblyDocument) return;
    var assyDoc = (AssemblyDocument)document;
    var assyOccs = assyDoc.ComponentDefinition.Occurrences;
    foreach (ComponentOccurrence occ in assyOccs)
    {
        if (occ.Suppressed)
        {
            occ.Delete();
        }
    }
}
Tags (1)
Labels (3)