Dimension Units

M

MoWood

Is it possible to set a dimension to show inches and fractions instead of
inches with a decimal; so... 21 3/8" not 21.375"
 
L

lew

Hi, I have tried to get this question answered before. Some have responded
with a fix in the shape sheet but I couldn't apply the fix. I've tried and
tried. If you get an answer and can understand it could you please post it.
 
J

John Marshall, MVP

It is, but it may require some surgery. If you use Insert Field the dialog
pages lets you select a limit number of formats.

To change to something else, you can open the shapesheet Find the Text
Fields section and change the number in the Format cell. The content should
be something like FIELDPICTURE(15). There is a full list of the numbers at
http://msdn2.microsoft.com/en-us/library/aa142115(office.10).aspx
but the one you want should be one of 13 for 12' 6 3/4" and 14 for 12' 6
46/75" (13 is for 1 place or 14 is for 2 places)
visFmtFeetAndInches1Pl
13

visFmtFeetAndInches2Pl
14



John... Visio MVP

Need stencils or ideas? http://visio.mvps.org/3rdparty.htm
Need VBA examples? http://visio.mvps.org/VBA.htm
Visio Wishlist http://visio.mvps.org/wish_list.htm
 
M

MoWood

Lew:

I'll do my best to give you the instructions. Once I was pointed in the
right direction, it was fairly easy to read and modify the shapesheet code
(formulas). I don't know your background, but if you have some experience
with Excel formulas, you should be able to understand the code. I suggest you
copy and paste from this message. Let me know if you have any questions.

1) From the Dimensioning stencil, copy the shape you want to modify to your
own stencil such as "myStencil". (Try the "Vertical" shape first. Note:
you'll need to modify the ShapeSheets for every dimension shape for which you
want to use inches and fractions)

2) Switch to your stencil, right-click on the stencil heading and select
"Edit Stencil". Right-click on the shape you just copied and select "Edit
Master" --> "Edit Master Shape". This opens the shape in a drawing window.

3) In this new window, right-click on the vertical shape and select "Show
ShapeSheet". Note: You have two options here. You can change the original
formatting for Feet-Inch or you can add another format using custom
variables. I chose the second option because I wanted to preserve the
Feet-inch format.

4) In the ShapeSheet, under "User-defined Cells", right-click on the bottom
variable (mine is "User.visVersion") and select "Insert Row". A new row is
created and labeled something like "User.Row_27". Now create another row
using the same method.

5) Rename the new variables (rows): "totalInches" and "inchFraction".

6) Following are formulas you'll need to use for the two new variables and
other variables in the ShapeSheet:

User.totalInches: =IF(User.LUnitsInd=10,0
in+INT(User.InchPrec*(User.Length)+1/2)/User.InchPrec,0)

User.inchFraction:
=IF(User.LUnitsInd=10,FORMAT(User.TotalInches,IF(User.TotalInches<1
in,"0/#"&User.InchPrec&"\""","0 #/#"&User.InchPrec&"\""")),0)

User.LengthText:
=IF(User.LUnitsInd=1,User.FeetInch,IF(User.LUnitsInd=10,User.inchFraction,FORMAT(User.Length,User.FormatString)))

User.LUnitsFactor:
=IF(User.LUnitsInd=0,User.DrawingUnitFactor,INDEX(User.LUnitsInd,"0;0FT
0IN;0.0FT;0IN;0FT;0MI;0 MM;0 CM;0 M;0 KM;0 IN"))

7) You can also modify the precision by changing the variable
"User.InchPrec" to 16, 32, 64 for 16ths, 32nds and 64ths respectively.

8) In the section called "Shape Data" modify the "Prop.LUnits" by adding the
new format called "inchFraction" to the !END! of the string so...

Prop.LUnits: ="Use Drawing Page's Units;Feet-Inch (1'-0"");Feet
(1.00');Inches;Feet
(1.00ft);Miles;Millimeters;Centimeters;Meters;Kilometers;.InchFraction"

(^^^ all one line )

9) Close the ShapeSheet and the shape drawing, then save the original
drawing. Try out your new shape in myStencils. You should see "inchFraction"
at the bottom of the format list under "Precision and Units". If it works,
you can copy it back to the Dimensions stencil. However, make sure it's
exactly what you want b/4 copying; you can't delete the shape from the
original Visio Dimension stencil once it's saved. Better yet, make a backup
copy of the stencil (in the file system) b/4 you start this entire procedure.

Good luck!

-Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top