Private Sub Form_Load()
Dim objApp As SolidEdgeFrameWork.Application
Dim objDoc As SolidEdgeDraft.DraftDocument
Dim objSheet As SolidEdgeDraft.Sheet
Dim objSmartFrame2d As SolidEdgeFrameworkSupport.SmartFrame2d
Dim objSmartFrame2dStyle As SolidEdgeFrameworkSupport.SmartFrame2dStyle
Dim objFrame As SolidEdgeFrameworkSupport.Frame
Dim cShape As SolidEdgeFrameworkSupport.FrameShapeConstants
' 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 SamrtFrames2d object
Set objSmartFrame2d = objSheet.SmartFrames2d.AddBy2Points(StyleName:="Reference", x1:=0.1, y1:=0.1, x2:=0.2, y2:=0.2)
'Get the Frame object
Set objFrame = objSmartFrame2d.Frame
objFrame.BorderVisible = True
'Get the Shape of the Frame
cShape = objFrame.ShapeOption
'Set the Shape to Ellipse
objFrame.ShapeOption = igEllipticalFrame
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objSheet = Nothing
Set objSmartFrame2d = Nothing
Set objSmartFrame2dStyle = Nothing
Set objFrame = Nothing
End Sub