Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNITS-Can I configure to only have selection of millimeters or inches 4

Status
Not open for further replies.

borsht

Mechanical
Oct 9, 2002
268
I am frequently switching my unit system from millimeters to inches, back and forth in certain projects, and am sick of scrolling thru all of the other unit selections. Is there a way to get rid of the other selections...feet,centimeters,meters and so on?
 
Replies continue below

Recommended for you

I'm with MElam on this one ... I have Imperial & Metric templates for Parts, Assemblies & Drawings.

[cheers]
Making the best use of this Forum. faq559-716
How to get answers to your SW questions. faq559-1091
Helpful SW websites every user should be aware of. faq559-520
 
'This macro will toggle between inches (3dec) and mm (2dec)
'Paste into a blank macro and assign a macro toolbar button

Dim swApp As Object
Dim Doc As Object
Dim retval As Boolean
Dim Msg As String

Const swUnitsLinear = 47
Const swUnitsLinearDecimalDisplay = 48
Const swUnitsLinearDecimalPlaces = 49
Const swMM = 0
Const swINCHES = 3

Const swDocASSEMBLY = 2

Sub main()

Set swApp = CreateObject("SldWorks.Application")
Set Doc = swApp.ActiveDoc

If Doc Is Nothing Then
Exit Sub
End If

If Doc.GetUserPreferenceIntegerValue(swUnitsLinear) = swINCHES Then
retval = Doc.SetUserPreferenceIntegerValue(swUnitsLinear, swMM)
retval = Doc.SetUserPreferenceIntegerValue(swUnitsLinearDecimalPlaces, 2)
ElseIf Doc.GetUserPreferenceIntegerValue(swUnitsLinear) = swMM Then
retval = Doc.SetUserPreferenceIntegerValue(swUnitsLinear, swINCHES)
retval = Doc.SetUserPreferenceIntegerValue(swUnitsLinearDecimalPlaces, 3)
End If

End Sub
 
Great suggestions here.

If as I often do, you have to mix systems in the same drawing, you can just type in the appropriate system when you need it, and leave the drawing system set to whichever is more frequent.

ie. type 34mm or 3.25" for your dimension.

Of course, this'll automatically convert the dimension to the other system, so sometimes I'll add a note in parenthesis to my dimension so I'll later remember that 2.992 is (76mm).
 
ongybill ... You could use dual dimensions instead of adding the note.

[cheers]
Making the best use of this Forum. faq559-716
How to get answers to your SW questions. faq559-1091
Helpful SW websites every user should be aware of. faq559-520
 
Sheet specic unit defaults and configurable dim options would be nice but until then...

We have a dimension favourite set up for each type of dimension i.e. fractional, 2 decimal, 3 decimal, dual, mm etc. You can then use the dimension filter to mass select a bunch of dims already added to the drawing and choose which favourite you would like to apply to them all. You can also choose your desired dimension favourite from the dim properties drop down list as you go.
 
We use a macro from Lenny's site called "unit manager" that is pretty easy to configure for different units, decimal places, and fractions, plus it has a simple dialog box that makes selection a snap.

The .txt file explains how to change the decimal places, fractions, etc., while the .ini file is where you do the actual changes.
For example, we do not use feet, meters, etc., so I deleted those and left the ones I wanted.
Save a backup of the "UnitManager.ini" file, and change the contents of the Unitmanager.ini file to:
Code:
' UnitManager.swp
' GENERAL INFORMATION:
' Units file must follow format below.
'
' Unit Name                Typ, Fra, Den/Plc
[UNITS]
"Inch (Decimal 2)",           3,   1,   2
"Inch (Decimal 4)",           3,   1,   4
"Inch (Fraction)",            3,   2,   32
"Millimeter (decimal 2)",     0,   0,   2

That gives you options for 2 or 4 decimal places, fractions rounded to 32nds of an inch, and milimeters to 2 decimal places.

Flores
 
I'll have to look up dual dimensions, never heard of that one.
 
You will find very little about it in the Help files.
RMB click on a dimension, select Properties, select Display as dual dimension.

[cheers]
Making the best use of this Forum. faq559-716
How to get answers to your SW questions. faq559-1091
Helpful SW websites every user should be aware of. faq559-520
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor