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

internal static class Example
{
    [STAThread()]
    public static void Main()
    {
        SolidEdgeFramework.Application objApplication = null;
        SolidEdgeAssembly.AssemblyDocument objAssemblyDocument = null;
        SolidEdgeAssembly.StructuralFrames objStructuralFrames = null;
//        SolidEdgeAssembly.StructuralFrame objStructuralFrame = null;

        try
        {
            OleMessageFilter.Register();

            objApplication = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
            objAssemblyDocument = objApplication.ActiveDocument;
            objStructuralFrames = objAssemblyDocument.StructuralFrames;

            // Loop through all of the structural frames.
            foreach (SolidEdgeAssembly.StructuralFrame objStructuralFrame in objStructuralFrames)
            {
                objStructuralFrame.RetrieveHoleLocation();
                objStructuralFrame.DeleteHoleLocation();
            }

        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
        finally
        {
            OleMessageFilter.Revoke();
        }
    }
}