Create Geometric Tolerances
From AutoCAD ActiveX
To create a geometric tolerance, use the AddTolerance method. This method requires three values as input: the text string comprising the tolerance symbol, the location in the drawing to place the tolerance, and a directional vector specifying the direction of the tolerance. You can also copy, move, erase, scale, and rotate tolerances.
This example creates a simple geometric tolerance in model space.
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 objecttextString = "Here is the Feature Control Frame"insertionPoint(0) = 5insertionPoint(1) = 5insertionPoint(2) = 0direction(0) = 1direction(1) = 1direction(2) = 0' Create the tolerance object in model spaceSet toleranceObj = ThisDrawing.ModelSpace. _AddTolerance(textString, insertionPoint, direction)ZoomAllEnd Sub