要创建形位公差,请使用 AddTolerance 方法。这个方法需要输入三个值:构成公差符号的文字字符串、图形中放置公差的位置以及用于指定公差方向的方向矢量。用户可以复制、移动、删除、缩放和旋转公差。
Sub Ch5_CreateTolerance()
Dim toleranceObj As AcadTolerance
Dim textString As String
Dim insertionPoint(0 To 2) As Double
Dim direction(0 To 2) As Double
' 定义公差对象
textString = "Here is the Feature Control Frame"
insertionPoint(0) = 5
insertionPoint(1) = 5
insertionPoint(2) = 0
direction(0) = 1
direction(1) = 1
direction(2) = 0
' 在模型空间中创建公差对象
Set toleranceObj = ThisDrawing.ModelSpace. _
AddTolerance(textString, insertionPoint, direction)
ZoomAll
End Sub