Wayne, Matt Lombard has some macros posted at his site to change the precision. I took them a step further. I've pasted my 3Place macro in below. I linked it to the number "3" on the keyboard. So all I do is select the dimension(s), and then hit 3. The precision changes to
3, and the alternate units precision changes to 4 if it's a metric drawing or 2 if it's an imperial drawing. The tolerance also updates to the same precision. Note the alternate unit and tolerance still have to be turned on/set for that dimension. I have a macro for
0Place, 1Place, 2Place, 3Place, and 4Place (you should be able to find the correct lines below to change in each macro), that I have linked to my 0, 1, 2, 3, & 4 keys. Only thing I don't like is that you have to pan the screen or do a refresh to get them to show up immediately. So usually I run one of the macros and the tap the MMB to make sure it updated the way I expected it too.
I also have one to switch to fractions if you're interested in that.
Enjoy, Ken Bolen
'****************************************************************************** ' 3Place.swb '****************************************************************************** Dim swApp As Object Dim Part As Object Dim SelMgr As Object Dim selCount As Integer Dim selType As Integer Dim retval As Variant Dim dimension As Object
'These definitions are consistent with type names defined in swconst.bas and swconst.h '*** swUserPreferenceIntegerValue *** Const swSelDIMENSIONS = 14 Const swUnitsLinear = 47 ' Millimeters=0, Inches=3 Sub main() Set swApp = CreateObject("SldWorks.Application") Set Part = swApp.ActiveDoc Dim MyVar001, MyVar002, MyVar003, MyVar004, MyVar005 As Integer MyVar005 = Part.GetUserPreferenceIntegerValue(swUnitsLinear) If MyVar005 = 3 Then 'For Inch Units MyVar001 = 3 'Primary Precision (Inch) MyVar002 = 3 'Primary Tolerance (Inch) MyVar003 = 2 'Alternate Precision (Metric) MyVar004 = 2 'Alternate Tolerance (Metric) Else 'For Metric Units MyVar001 = 3 'Primary Precision (Metric) MyVar002 = 3 'Primary Tolerance (Metric) MyVar003 = 4 'Alternate Precision (Inch) MyVar004 = 4 'Alternate Tolerance (Inch) End If Set SelMgr = Part.SelectionManager() selCount = SelMgr.GetSelectedObjectCount() If (selCount > 0) Then Dim i As Integer For i = 1 To selCount selType = SelMgr.GetSelectedObjectType2(i) If (selType = swSelDIMENSIONS) Then Set dimension = SelMgr.GetSelectedObject3(i) Dim primaryPrec As Long Dim alternatePrec As Long Dim primaryTol As Long Dim alternateTol As Long retval = dimension.GetUseDocPrecision() primaryPrec = MyVar001 primaryTol = MyVar002 alternatePrec = MyVar003 alternateTol = MyVar004 retval = dimension.SetPrecision(False, primaryPrec, alternatePrec, primaryTol, alternateTol) 'line wrapped in newsgroup post End If Next End If End Sub