Private Sub Form_Load()
Dim objApp As SolidEdgeFrameWork.Application
Dim objDoc As SolidEdgeDraft.DraftDocument
Dim objSheet As SolidEdgeDraft.Sheet
Dim objEllipses As SolidEdgeFrameworkSupport.Ellipses2d
Dim objEllipse1 As SolidEdgeFrameworkSupport.Ellipse2d
Dim objEllipse2 As SolidEdgeFrameworkSupport.Ellipse2d
Dim objEllipse3 As SolidEdgeFrameworkSupport.Ellipse2d
Dim objEllipse4 As SolidEdgeFrameworkSupport.Ellipse2d
Dim lngZorder As Long
' 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
'Get the Ellipses2d object
Set objEllipses = objSheet.Ellipses2d
'Create an ellipse2d object
Set objEllipse1 = objEllipses.AddByCenter(xCenter:=0.3, yCenter:=0.25, _
xMajor:=0.1, yMajor:=0, Ratio:=0.5, Orientation:=igGeom2dOrientClockwise)
Set objEllipse2 = objEllipses.AddByCenter(xCenter:=0.3, yCenter:=0.25, _
xMajor:=0.08, yMajor:=0, Ratio:=0.3, Orientation:=igGeom2dOrientClockwise)
Set objEllipse3 = objEllipses.AddByCenter(xCenter:=0.15, yCenter:=0.15, _
xMajor:=0.1, yMajor:=0, Ratio:=0.5, Orientation:=igGeom2dOrientClockwise)
Set objEllipse4 = objEllipses.AddByCenter(xCenter:=0.15, yCenter:=0.15, _
xMajor:=0.08, yMajor:=0, Ratio:=0.3, Orientation:=igGeom2dOrientClockwise)
lngZorder = objEllipse4.ZOrder
Call objEllipse4.SendBackward
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objSheet = Nothing
Set objEllipses = Nothing
Set objEllipse1 = Nothing
Set objEllipse2 = Nothing
Set objEllipse3 = Nothing
Set objEllipse4 = Nothing
End Sub