Private Sub Form_Load()
Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgeDraft.DraftDocument
Dim objSheet As SolidEdgeDraft.Sheet
Dim objBounds As SolidEdgeFrameworkSupport.Boundaries2d
Dim objBound As SolidEdgeFrameworkSupport.Boundary2d
Dim objBoundingObjs As SolidEdgeFrameworkSupport.BoundingObjects2d
Dim objCircles(0) As SolidEdgeFrameworkSupport.Circle2d
' 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 object
Set objSheet = objDoc.ActiveSheet
'Get the Boundaries2d object on the active sheet
Set objBounds = objSheet.Boundaries2d
'Create a cricle2d object
Set objCircles(0) = objSheet.Circles2d.AddByCenterRadius(x:=0.1, y:=0.1, Radius:=0.02)
'Create boundary by object method
Set objBound = objBounds.AddByObjects(ObjectCount:=1, Objects:=objCircles, xFlood:=0.1, yFlood:=0.1)
'Get Bounding objects collection
Set objBoundingObjs = objBound.BoundingObjects
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objSheet = Nothing
Set objBounds = Nothing
Set objBound = Nothing
Set objBoundingObjs = Nothing
Set objCircles(0) = Nothing
End Sub