Private Sub btnFenceLocate_Click(sender As System.Object, e As System.EventArgs) Handles btnFenceLocate.Click
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDraftDoc As SolidEdgeDraft.DraftDocument = Nothing
Dim objSheet As SolidEdgeDraft.Sheet = Nothing
Dim objType As Type = Nothing
Dim SelSet As SolidEdgeFramework.SelectSet = Nothing
Dim i As Integer
Try
objApplication = Marshal.GetActiveObject("SolidEdge.Application")
If objApplication Is Nothing Then
' Get the type from the Solid Edge ProgID
objType = Type.GetTypeFromProgID("SolidEdge.Application")
' Start Solid Edge
objApplication = Activator.CreateInstance(objType)
' Make Solid Edge visible
objApplication.Visible = True
End If
objDraftDoc = objApplication.ActiveDocument
objSheet = objDraftDoc.ActiveSheet
Call objSheet.FenceLocate(0.0787, 0.3625, 0.4445, 0.089)
SelSet = objDraftDoc.SelectSet
i = SelSet.Count
MsgBox(i.ToString)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub