﻿using System.IO;
using System.Runtime.InteropServices;

internal static class Example
{
    [STAThread()]
    public static void Main()
    {
        SolidEdgeFramework.Application objApplication = null;
        SolidEdgePart.PartDocument objPartDocument = null;
        SolidEdgePart.FamilyMembers objFamilyMembers = null;
//        SolidEdgePart.FamilyMember objFamilyMember = null;
        object objRelationship = null;
        int i = 0;

        try
        {
            OleMessageFilter.Register();

            // Connect to Solid Edge
            objApplication = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
            objApplication.Visible = true;
            objPartDocument = objApplication.ActiveDocument;
            objFamilyMembers = objPartDocument.FamilyMembers;

            // Loop through all family members
            foreach (SolidEdgePart.FamilyMember objFamilyMember in objFamilyMembers)
            {
                // Loop through suppressed relationships.
                for (i = 1; i <= objFamilyMember.SuppressedRelationshipCount; i++)
                {
                    // Get SuppressedRelationship at given index.
                    objRelationship = objFamilyMember.SuppressedRelationship(i);
                }
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
        finally
        {
            OleMessageFilter.Revoke();
        }
    }
}