Private Sub Form_Load()
Dim objApp As SolidEdgeFramework.Application
Dim objDoc As SolidEdgePart.PartDocument
Dim objProfile As SolidEdgePart.Profile
Dim objL1 As SolidEdgeFrameworkSupport.Line2d
Dim objL2 As SolidEdgeFrameworkSupport.Line2d
Dim objL3 As SolidEdgeFrameworkSupport.Line2d
Dim objD1 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 a Profile with 3 Line objects in it
Set objProfile = objDoc.ProfileSets.Add.Profiles.Add(pRefPlaneDisp:=objDoc.RefPlanes(1))
Set objL1 = objProfile.Lines2d.AddBy2Points(x1:=0.05, y1:=0.05, x2:=0.03, y2:=0.03)
Set objL2 = objProfile.Lines2d.AddBy2Points(x1:=0, y1:=0, x2:=0, y2:=0.05)
Set objL3 = objProfile.Lines2d.AddBy2Points(x1:=0, y1:=0, x2:=0.05, y2:=-0.02)
'Set the AngleCompliment value to false, in case it is set to true
objProfile.Dimensions.AngleCompliment = False
'Place a Dimension
Set objD1 = objProfile.Dimensions.AddAngleBetween3Objects(ele1:=objL3, x1:=0.05, _
y1:=0, z1:=0, keyPoint1:=True, ele2:=objL2, x2:=0, y2:=0.05, z2:=0, _
keyPoint2:=True, ele3:=objL1, x3:=0.03, y3:=0.03, z3:=0, keyPoint3:=True)
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objProfile = Nothing
Set objL1 = Nothing
Set objL2 = Nothing
Set objL3 = Nothing
Set objD1 = Nothing
End Sub