Imports System.Runtime.InteropServices
Public Class frmAddCenterArc
Private Sub btnAddCenterArc_Click(sender As System.Object, e As System.EventArgs) Handles btnAddCenterArc.Click
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDraftDoc As SolidEdgeDraft.DraftDocument = Nothing
Dim objCenterLines As SolidEdgeFrameworkSupport.CenterLines = Nothing
Dim objType As Type = Nothing
Dim objArc1 As Object = Nothing
Dim objArc2 As Object = Nothing
Try
' Create/get the application with specific settings
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
' drawing an arcs on the active sheet
objArc1 = objDraftDoc.ActiveSheet.Arcs2d.AddByCenterStartEnd(0.5, 0.3, 0.2, 0.1, 0.6, 0.2)
objArc2 = objDraftDoc.ActiveSheet.Arcs2d.AddByCenterStartEnd(0.5, 0.3, 0.1, 0.12, 0.7, 0.25)
' getting the CenterLines object
objCenterLines = objDraftDoc.ActiveSheet.CenterLines
' drawing a center arc on the active sheet using the two arcs
Call objCenterLines.AddCenterArcBy2Arcs(objArc1, objArc2)
' getting the CenterLines object on the active sheet
objCenterLines = objDraftDoc.ActiveSheet.CenterLines
' drawing a center arc by center point on the active sheet
Call objCenterLines.AddCenterArcBy3Points(Nothing, 0.05, 0.02, 0.0#, False, Nothing, 0.1, 0.04, 0.0#, False, Nothing, 0.2, 0.03, 0.0#, False)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class