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

This is the function from my active project

This function will hides all occurrences in the "basView" except the "occ". Argument "asm" is referenced document of "baseView"

 

private static void HideOtherOccurrences(AssemblyDocument asm, ComponentOccurrence occ, DrawingView baseView)
{
    Point2d position = baseView.Position;
    foreach (ComponentOccurrence occurrence in asm.ComponentDefinition.Occurrences)
    {
        baseView.SetVisibility(occurrence, occurrence == occ);
    }

    baseView.Position = position;
}