Imports System.IO
Imports System.Runtime.InteropServices
Module Example
<STAThread()> _
Sub Main()
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objPartDocument As SolidEdgePart.PartDocument = Nothing
Dim objModels As SolidEdgePart.Models = Nothing
Dim objModel As SolidEdgePart.Model = Nothing
Dim objSubtracts As SolidEdgePart.Subtracts = Nothing
Dim objSubtract As SolidEdgePart.Subtract = Nothing
Try
OleMessageFilter.Register()
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objPartDocument = objApplication.ActiveDocument
objModels = objPartDocument.Models
objModel = objModels.Item(1)
objSubtracts = objModel.Subtracts
objSubtract = objSubtracts.Item(1)
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
OleMessageFilter.Revoke()
End Try
End Sub
End Module