News:

Happy New Year!

Main Menu

how to get dimension lines show both in and cm

Started by coach_z, January 02, 2009, 06:24:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

coach_z

Hello,

I was wondering if someone could help me out editing an existing shape (or creating a new shape i guess) to have a dimension that shows both inches and centimeters in this format:

1 in
(2.54 cm)

and

1 1/2 in
(3.81 mm)

thank you so much for your help!
-Chris

wapperdude

I'm assuming that you are using the dimension shapes from the General Dimensioning stencil.  If you click on the shape and then open it's shapesheet (menu bar> Window > Show Shapesheet), then scroll down to near the bottom for the TextField section.  The Value cell should have a formula like:  =User.LengthText.  Change this text to: =GUARD(User.LengthText & CHAR(10) & "(" & FORMATEX(User.Length,"0.00 u","in","cm") & ")").

The guard function hopefully keeps the formula from getting clobbered by Visio code.  The Char(10) is a line feed.  Info on Formatex function may be found here:  http://msdn.microsoft.com/en-us/library/ms406694.aspx.  The format of the numbers inside the parenthesis will be hard coded.

HTH
Wapperdude
Visio 2019 Pro

wapperdude

Ah!   :o  The following formula change no longer hard codes the precision for the 2nd parenthetical dimension:
=GUARD(User.LengthText&CHAR(10)&"("&FORMATEX(User.Length,User.FormatString,"in","cm")&")")   ;D
Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 196 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1053KB.
Tokens: post-login.
Cache hits: 13: 0.00109s for 26,600 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]