Using the Tolerance Object

The Tolerance object represents a geometric tolerance in a feature control frame. Tolerances specify allowable deviations of orientation, location, and so on, from the exact geometry of a drawing.

Set ToleranceObject = Object.AddTolerance(Text, _ InsertionPoint, TextDirection)

Table 11-12 shows the AddTolerance method's parameters.

Table 11-12. The AddTolerance Method's Parameters

Name

Data Type

Description

Text

String

The text string to be displayed

InsertionPoint

Variant

A three-element array of doubles specifying the WCS point at which the tolerance is inserted

TextDirection

Variant

A three-element array of doubles specifying the three-dimensional vector for the direction of the tolerance text

Figure 11-8 depicts a tolerance feature flag.

Figure 11-8 depicts a tolerance feature flag.

This code adds a Tolerance object to model space with the user-chosen text, position, and direction:

Public Sub CreateTolerance() Dim strToleranceText As String Dim varInsertionPoint As Variant Dim varTextDirection As Variant Dim intI As Integer Dim objTolerance As AcadTolerance strToleranceText = InputBox("Please enter the text for the tolerance") varInsertionPoint = ThisDrawing.Utility.GetPoint(, _

"Please enter the insertion point for the tolerance") varTextDirection = ThisDrawing.Utility.GetPoint(varInsertionPoint, _

"Please enter a direction for the tolerance")

varTextDirection(intI) = varTextDirection(intI) - varInsertionPoint(intI) Next

Set objTolerance = ThisDrawing.ModelSpace.AddTolerance(strToleranceText, _

varInsertionPoint, varTextDirection)

End Sub

Table 11-13 shows the formatting codes for Tolerance symbols.

Table 11-13. Formatting Codes for the Tolerance Feature's Flag Symbols

Code

Symbol

{\Fgdt

a}

Angularity symbol (similar to <)

{\Fgdt

b}

Perpendicularity symbol (two perpendicular lines)

{\Fgdt

c}

Flatness symbol (parallelogram)

{\Fgdt

d}

Profile of a surface symbol (closed half-circle)

{\Fgdt

e}

Circularity or roundness symbol (single circle)

{\Fgdt

f}

Parallelism symbol (//)

{\Fgdt

g}

Cylindricity symbol (/O/)

{\Fgdt

h}

Circular runout symbol (/)

{\Fgdt

i}

Symmetry symbol (like a division sign)

{\Fgdt

j}

Positional symbol (circle with a cross in it)

{\Fgdt

k}

Profile of a line symbol (open half-circle)

{\Fgdt

l}

Least material condition symbol (circle with an L in it)

{\Fgdt

m}

Maximum material condition symbol (circle with an M in it)

{\Fgdt

n}

Diameter symbol

{\Fgdt

o}

Square symbol

{\Fgdt

p}

Projected tolerance zone symbol (circle with a P in it)

{\Fgdt

q}

Centerline symbol

{\Fgdt

r}

Concentricity symbol (two concentric circles)

{\Fgdt

s}

Regardless of feature size (circle with an S in it)

{\Fgdt

t}

Total runout symbol ()

{\Fgdt

u}

Straightness symbol (-)

{\Fgdt

v}

Counterbore symbol

{\Fgdt

w}

Countersink symbol

{\Fgdt

x}

Depth symbol

{\Fgdt

y}

Conical taper symbol

{\Fgdt

z}

Slope symbol

%%v

Used to create a vertical separation line between each symbol

Tolerances are related to the dimension objects and so are influenced by several dimension system variables: DIMCLRD controls the color of the feature control frame, DIMCLRT controls the color of the tolerance text, DIMGAP controls the gap between the feature control frame and the text, DIMTXT controls the size of the tolerance text, and DIMTXTSTY controls the style of the tolerance text.

Was this article helpful?

0 0

Post a comment