AddTolerance Example

Using Programming Languages other than VBA

Sub Example_AddTolerance()
	' This example creates a tolerance object in model space.

	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 = "{\Fgdt;r}%%vasdf{\Fgdt;l}%%vdf%%vxc%%v12{\Fgdt;m}%%vsd" & vbCrLf & _
		"{\Fgdt;t}%%vdfd%%v3dd{\Fgdt;l}%%vv%%v%%vxc{\Fgdt;m}" & vbCrLf & _
		"123"
			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

 

   Comments?