I wrote up a macro to change the diameter tolerance, I can change the number of decimal points but I cannot add the tolerance valve to the drawing. Please help.Please see the attached picture and code
I wrote up a macro to change the diameter tolerance, I can change the number of decimal points but I cannot add the tolerance valve to the drawing. Please help.Please see the attached picture and code
Hi Marco,
please take a look at following code:
'Get the selection
Set swDisplayDimension = swSelMgr.GetSelectedObject6(1, 0)
' If selection is not a dimension, then exit
If swSelMgr.GetSelectedObjectType3(1, -1) <> swSelDIMENSIONS Then Exit Sub
' Selection is a dimension, so get the dimension tolerance object
Set swDimension = swDisplayDimension.GetDimension
status = swDisplayDimension.SetPrecision3(2, 2, 2, 2)
Set swDimensionTolerance = swDimension.Tolerance
' Set type of Tolerance
swDimensionTolerance.Type = swTolBILAT
' Set dimension tolerance value
status = swDimensionTolerance.SetValues(0.00002, 0.00005)
Debug.Print ("Minimum dimension tolerance: " & swDimensionTolerance.GetMinValue)
Debug.Print ("Maximum dimension tolerance: " & swDimensionTolerance.GetMaxValue)
Does someone have any suggestion?