Get a shape to display its area and its dimensions?

Started by Jennifer, November 02, 2011, 12:59:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jennifer

I hope this is the right forum for this question.

I know how to get a line to display its length using Insert | Field and selecting the Geometry category.

I just experimented with the Custom Formula option. I was able to get a rectangle to display its area using the formula

     =Width*Height

and a circle using

   =((Width/2)^2)*PI()

Magic!

Is there a way to get them to display both the dimensions and the area like this:

   2.0 x 3.0
       6.0

or maybe

         18.69
    (3.25 x 5.75)

Thanks
Using Visio 2019, part of Office 365 on Windows 10


Jennifer

Al,

Thanks for the link. That looks like a very comprehensive solution, but I'm afraid it's overkill for me.

All I want to do is mix geometry values with text and may do a little simple arithmetic on the values.

I was hoping for something one of these using the Custom Formula option:

   =width "x" height

or

   =width & "x" & height

Is anything like that possible?
Using Visio 2019, part of Office 365 on Windows 10

aledlund

Your 'simple' solution can be handled for simple shapes by adding a shape data cell to do the math and then adding a text field to do the formatting. However the smarts to have a general solution that works across multiple types of shapes will probably require some code. As an example putting your circle formula into a rectangle shape is probably inappropriate.
al


Jennifer

I'm not looking for a general solution. All I want to do is be able to intermix (concatentate?) values and text for one specific shape on one specific drawing.

In Excel, for example, I can specify a custom format like [0.00 "feet"]. Or I can concatenate text and numeric data using the "&" operator [=A1 & "x" & B1] and various formatting functions such as text().

It sounds like nothing like that is available in Visio.
Using Visio 2019, part of Office 365 on Windows 10

aledlund

Jennifer,
David did something like that over here
http://davidjpp.wordpress.com/2011/10/13/formatting-custom-units-in-visio/

certainly less complicated and more appropriate to what you are attempting to accomplish. Obviously you don't need the data graphics part of the discussion.

al

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: 228 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1090KB.
Tokens: post-login.
Cache hits: 13: 0.00121s for 26,616 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]