Author Topic: Displaying Line Length  (Read 484 times)

0 Members and 1 Guest are viewing this topic.

visioboy

  • Newbie
  • *
  • Posts: 4
Displaying Line Length
« on: August 17, 2022, 03:39:06 PM »
Greetings all...

I am trying to display a line length on a drawing in feet and inches.  I'm doing this by using the Insert/Text Field option.  I have found how to display the length properly but I don't like the formatting it is using.  Right now, I'm using a Custom Field with this value: =FORMAT(Width,"0 u")

While this works, it shows the dimension as "6 ft. 8 in.".  I would like this to read using the more traditional marks like 6' 8".  Is there some other formatting option I am unaware of instead of using the 'u' character to get the feet and inches marks instead of the words?

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4449
  • Ideas Visio-lized into solutions
Re: Displaying Line Length
« Reply #1 on: August 17, 2022, 04:37:13 PM »
Open the shapesheet and scroll to the Text Fields section.  The Format cell has the formula used to control the display precision and units format.

A more "univeral" formula would be =Fieldpicture(somevaluie).  Or, if the shapesheet is displaying values not formula, this equates to =esc(somevalue).

Questtion is what are the value choices and do any exist for the desired formating requested.  Here's a link to all possible entries:  https://docs.microsoft.com/en-us/office/vba/api/visio.visfieldformats

If you scroll down far enough, you see entry for:  visFmtFeetAndInches, which has value of 10.  Place that value into the shapesheet, e.g., esc(10).  That might suffice.  If not, try codes 13 - 18.  Each of these entries works in conjunction with the page property settings.  Of most interest would be inches and feet & inches.

« Last Edit: August 17, 2022, 04:43:00 PM by wapperdude »
Visio 2019 Pro

visioboy

  • Newbie
  • *
  • Posts: 4
Re: Displaying Line Length
« Reply #2 on: August 17, 2022, 04:42:10 PM »
I used FIELDPICTURE(10) in the Format area, value is set to FORMAT(Width,"0 u").

Perfection!  Thanks so much!  :)

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4449
  • Ideas Visio-lized into solutions
Re: Displaying Line Length
« Reply #3 on: August 28, 2022, 12:37:55 AM »
Just ran across this post.  It edits the pc's Registry to "hard code" the default format for displaying numbers in Visio.

http://visguy.com/vgforum/index.php?topic=6581.msg45569;topicseen#msg45569
Visio 2019 Pro