Private Sub Form_Load()
Dim objApp As SolidEdgeFrameWork.Application
Dim objDoc As SolidEdgeDraft.DraftDocument
Dim objSheet As SolidEdgeDraft.Sheet
Dim objLine1 As SolidEdgeFrameworkSupport.Line2d
Dim objLine2 As SolidEdgeFrameworkSupport.Line2d
Dim objDimension As SolidEdgeFrameworkSupport.Dimension
Dim bDisplayHalf As Boolean
' 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
'create line2d
Set objLine1 = objSheet.Lines2d.AddBy2Points(0.2, 0.35, 0.2, 0.4)
Set objLine2 = objSheet.Lines2d.AddBy2Points(0.25, 0.35, 0.25, 0.4)
'create a dimension
Set objDimension = objSheet.Dimensions.AddSymmetricalDiameter _
(Object1:=objLine1, x1:=0.2, y1:=0.35, z1:=0, Keypoint1:=True, _
Object2:=objLine2, x2:=0.25, y2:=0.35, z2:=0, Keypoint2:=True)
'get the boolean property DisplayHalf
bDisplayHalf = objDimension.DisplayHalf
'set the boolean property DisplayHalf
objDimension.DisplayHalf = True
' USER DISPLAY
' Release objects
Set objApp = Nothing
Set objDoc = Nothing
Set objSheet = Nothing
Set objDimension = Nothing
Set objLine1 = Nothing
Set objLine2 = Nothing
End Sub