Private Sub Form_Load()
Dim objApp As SolidEdgeFrameWork.Application
Dim objDoc As SolidEdgeDraft.DraftDocument
Dim objSheet As SolidEdgeDraft.Sheet
Dim objArc2d As SolidEdgeFrameworkSupport.Arc2d
Dim strlay As String
Dim strlay1 As String
' Report errors
Const PI = 3.14159265358979
' Create/get the application with specific settings
On Error Resume Next
Set objApp = GetObject(, "SolidEdge.Application")
If Err Then
Err.Clear
Set objApp = CreateObject("SolidEdge.Application")
Set objDoc = objApp.Documents.Add("SolidEdge.DraftDocument")
objApp.Visible = True
Else
Set objDoc = objApp.ActiveDocument
End If
'getting the Active Sheet object
Set objSheet = objDoc.ActiveSheet
'create the arc2d object
Set objArc2d = objSheet.Arcs2d.AddByCenterStartEnd(xCenter:=0, yCenter:=0, _
xStart:=0.382, yStart:=0.105, xEnd:=0.2207, yEnd:=0.329)
'get the layer of the object
strlay = objArc2d.Layer
'set a layer
Call objSheet.Layers.Add("TopLayer")
objArc2d.Layer = "TopLayer"
'get the new layer
strlay1 = objArc2d.Layer
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objSheet = Nothing
Set objArc2d = Nothing
End Sub