Private Sub Form_Load()
Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgeDraft.DraftDocument
Dim objSheet As SolidEdgeDraft.Sheet
Dim objCircle As SolidEdgeFrameworkSupport.Circle2d
Dim objGeometricStyle As SolidEdgeFrameworkSupport.GeometryStyle2d
Dim strName 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
objDoc.LinearStyles.Active = "Center"
'Create a circle in the active sheet.
Set objCircle = objSheet.Circles2d.AddByCenterRadius(x:=0.2, y:=0.2, _
Radius:=0.1)
'Create a geometric style2d for the Circle
Set objGeometricStyle = objCircle.Style
'Get the Linearname of the Style
strName = objGeometricStyle.LinearName
'Set the Linear name to Cutting Plane
objGeometricStyle.LinearName = "Cutting Plane"
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objSheet = Nothing
Set objCircle = Nothing
Set objGeometricStyle = Nothing
End Sub