Private Sub Form_Load()
Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgePart.PartDocument
Dim objProfile As SolidEdgePart.Profile
Dim objC1 As SolidEdgeFrameworkSupport.Circle2d
Dim objC2 As SolidEdgeFrameworkSupport.Circle2d
Dim objDimns As SolidEdgeFrameworkSupport.Dimensions
Dim objDim1 As SolidEdgeFrameworkSupport.Dimension
Dim sDumpStatus As String ' Used for temporary storage of datadump return 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.PartDocument")
objApp.Visible = True
Else
Set objDoc = objApp.ActiveDocument
End If
' Create an empty Profile
Set objProfile = objDoc.ProfileSets.Add.Profiles.Add(pRefPlaneDisp:= _
objDoc.RefPlanes(1))
' Create 2 Circle2d objects in the Profile
Set objC1 = objProfile.Circles2d.AddByCenterRadius(x:=0, y:=0, Radius:=0.01)
Set objC2 = objProfile.Circles2d.AddByCenterRadius(x:=0.02, y:=0.02, Radius:=0.01)
' Create a Dimension object
Set objDimns = objProfile.Dimensions
Set objDim1 = objDimns.AddSymmetricalDiameter(Object1:=objC1, x1:=0, y1:=0, _
z1:=0, keyPoint1:=True, object2:=objC2, x2:=0.02, _
y2:=0.02, z2:=0, keyPoint2:=True)
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objProfile = Nothing
Set objC1 = Nothing
Set objC2 = Nothing
Set objDimns = Nothing
Set objDim1 = Nothing
End Sub