概要 - 幾何公差を記入する(VBA/ActiveX)

幾何公差を記入するには、AddTolerance メソッドを使用します。

このメソッドでは、幾何公差記号を含む文字列、幾何公差を配置する図面内の位置、幾何公差の方向を指定する方向ベクトルという 3 つの値を指定する必要があります。公差記入枠は、複写、移動、削除、尺度変更、回転が可能です。

幾何公差を記入する

次の例は、モデル空間に簡単な幾何公差を記入します。

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

    ' Define the tolerance object
    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
    ' Create the tolerance object in model space
    Set toleranceObj = ThisDrawing.ModelSpace. _
        AddTolerance(textString, insertionPoint, direction)
    ZoomAll
End Sub