The user must select a single dimension for updating. This part works fine.
The problem is that I can not set the tolerance precision. The dimension precision is set by EditDimensionProperties2, but this does not set the tolerance precision.
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long
Dim Annotation As Object
Dim Gtol As Object
Dim DatumTag As Object
Dim FeatureData As Object
Dim Feature As Object
Dim theDimen As Object
Dim Component As Object
Sub main()
Set swApp = CreateObject("SldWorks.Application"

Set Part = swApp.ActiveDoc
Set model = Part
Set SelMgr = model.SelectionManager() ' Get the selection manager class
If (SelMgr.GetSelectedObjectCount <> 0) Then ' If user has selected something
Set selObj = SelMgr.GetSelectedObject2(1) ' Get the first item in the selection list
selObjName = selObj.FullName ' Get the name of the selected component
messageString = "Member name is " + selObjName
swApp.SendMsgToUser messageString ' Display to the user
Part.SelectByID selObjName, "DIMENSION", 0, 0, 0
HoleUpperLimit = 2.5
HoleLowerLimit = 1.5
MaxTolerance = HoleUpperLimit * 0.0000254
MinTolerance = HoleLowerLimit * 0.0000254
Part.EditDimensionProperties2 2, MaxTolerance, MinTolerance, "", "", 0, 4, 1, 1, 11, 11, "", "", 1, "", "", 0
model.GraphicsRedraw2
Set theDimen = Part.Parameter(selObjName)
theValue = theDimen.Value
End If
retval = theDimen.setPrecision(0, 4, 2, 4, 2) ' It doesn't seem to recognize SetPrecision
End Sub