Imports System.IO
Imports System.Runtime.InteropServices
Module Example
<STAThread()> _
Sub Main()
Dim objApplication As SolidEdgeFramework.Application
Dim objDraftDocument As SolidEdgeDraft.DraftDocument
Dim objSheet As SolidEdgeDraft.Sheet
Dim objLines2d As SolidEdgeFrameworkSupport.Lines2d
Dim objHzLine2d As SolidEdgeFrameworkSupport.Line2d
Dim objVtLine2d As SolidEdgeFrameworkSupport.Line2d
Try
OleMessageFilter.Register()
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
objDraftDocument = objApplication.Documents.Add("SolidEdge.DraftDocument")
objSheet = objDraftDocument.ActiveSheet
objLines2d = objSheet.Lines2d
'Add a horizontal line and a vertical line
objHzLine2d = objLines2d.AddBy2Points(x1:=0.2, y1:=0.2, x2:=0.3, y2:=0.2)
objVtLine2d = objLines2d.AddBy2Points(x1:=0.35, y1:=0.35, x2:=0.35, y2:=0.25)
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
OleMessageFilter.Revoke()
End Try
End Sub
End Module