Private Sub Form_Load()
Dim objApp As SolidEdgeframework.Application
Dim objDoc As Solidedgedraft.DraftDocument
Dim objCirc1 As SolidEdgeframeworksupport.Circle2d
Dim objRelns As SolidEdgeframeworksupport.Relations2d
Dim objReln1 As SolidEdgeframeworksupport.Relation2d
Dim objSheet As Solidedgedraft.Sheet
' 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
' Get the active sheet
Set objSheet = objDoc.ActiveSheet
' Create a Circle object
Set objCirc1 = objSheet.Circles2d.AddByCenterRadius(x:=0.25, y:=0.25, Radius:=0.1)
' Create a Fix Relation between the objects
Set objRelns = objSheet.Relations2d
Set objReln1 = objRelns.AddFix(Object:=objCirc1)
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objCirc1 = Nothing
Set objRelns = Nothing
Set objSheet = Nothing
Set objReln1 = Nothing
End Sub