Imports System.IO
Imports System.Runtime.InteropServices
Module Example
<STAThread()> _
Sub Main()
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDraftDocument As SolidEdgeDraft.DraftDocument = Nothing
Dim objSheet As SolidEdgeDraft.Sheet = Nothing
Dim objDrawingViews As SolidEdgeDraft.DrawingViews = Nothing
Dim objDrawingView As SolidEdgeDraft.DrawingView = Nothing
Dim objModelMembers As SolidEdgeDraft.ModelMembers = Nothing
Dim objModelMember As SolidEdgeDraft.ModelMember = Nothing
Dim strPrimaryMember As String
Try
OleMessageFilter.Register()
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objDraftDocument = objApplication.ActiveDocument
objSheet = objDraftDocument.ActiveSheet
objDrawingViews = objSheet.DrawingViews
objDrawingView = objDrawingViews.Item(1)
strPrimaryMember = objDrawingView.PrimaryMember
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
OleMessageFilter.Revoke()
End Try
End Sub
End Module