• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Visio Guy

Smart graphics for visual people




  • Home
  • Hire Me
    • Hire Me
    • Résumé
  • Products
    • Products
    • Bubble Revision Shape
    • Layers to Pages Utility
    • Rack Unit Dimension Line
    • Radial Elements Tool with up to 100 Wedges
    • Text on a Circle Visio SmartShape
  • Index
    • Articles by Date
    • YouTube – VisioGuy
    • Download Information
    • Suggestion Box
    • Shop
    • Visio Art
    • Visio Links
    • – Visio Shapes & Stencils
    • – Visio Templates & Drawings
  • About
    • About
    • Donate
    • GitHub
    • jsFiddle
    • Reading List
    • Subscribe & Follow
      • – E-mail
      • – facebook
      • – Twitter
      • – RSS
    • Privacy Policy
  • Discussion Forum
You are here: Home / Add-ins & Tools / Map Distance Dimension Line

Map Distance Dimension Line

July 13, 2007 By Visio Guy 19 Comments

In this article, we share with you a dimension line SmartShape that can be calibrated to a scale on an imported image, and be subsequently used to measure distances in that space.

Since Visio is adept at importing images in a variety of formats, it can be a great time savings to start with an image as a background or basis for a diagram that you wish to produce. There are many scenarios where the imported art represents a scaled drawing, be it a map, a floor plan, or some other architectural drawing.

In such cases, you might want to be able to accurately show the dimensions of various objects or the distances between points on the drawing. But this can be difficult without first accurately resizing the image to fit a predefined scale.

In the Visio file that you can download at the end of this article, you’ll find a master shape called Map Dimension. This shape has a text field that shows the scaled length of the shape, after it has been calibrated. Once you calibrate the shape, you can stretch it to any size, and the length of the shape will be accurately reflected in the text.

But first you need to calibrate the shape!

To calibrate the Map Distance shape, we need to compare it to a known distance on your imported image. Below, we see a map of Oahu that has a handy-dandy distance scale. The scale shows a distance of 6 miles, and we need to make our shape just as long as that scale. But when you drop and accurately stretch the Map Dimension, it will only be about 1.5 inches long!

To calibrate the text, we simply need to right-click it, and choose Set Current Size… from the menu. You’ll be presented with a Custom Property (Shape Data) dialog that has a field labeled Current Size.

Just enter the value of the known distance on your imported image. In this case, we need to enter 6 miles, but you can shorten it to “6 mi”. Visio understands common unit abbreviations such as: km, m, cm, mm, mi, yd, ft, in.

Set Current Size of Map Distance Dimension Line

click to view larger image

Now maps often show roads, and roads are rarely straight, so we’ve added legs to the shape. You can right-click the shape and add up to 3 legs to help increase the accuracy of your measurements.

Map Distance Dimension Line with 3 legs

I won’t provide a treatise as to how this shape was built, but I encourage you to visit its ShapeSheet and have a look around. Of particular note is what happens when you enter a new value for Current Size, which is stored in the cell: Prop.CurrentSize.

A particular cell named User.watchCurrentSize uses the DEPENDSON function to wait for changes in the value of Prop.CurrentSize. You can see the full formula here:

User.watchCurrentSize =

DEPENDSON(Prop.CurrentSize)+SETF(GetRef(User.dReference),GetRef(Width))

When DEPENDSON detects a change, then the rest of the formula “fires”. In this case, we see that there’s a SETF formula, which pushes the current value of the Width cell into the User.dReference cell. This allows us to store the Visio-size of our dimension-line at the time that we entered a value for CurrentSize: we have a historical value. We can then compare the current size of the shape, with the size at the time CurrentSize was set, create a ratio, and multiply that times Prop.CurrentSize to get the scaled length of the dimension line.

With the addition of extra legs in the shape, it all gets more complicated in practice, but the theory remains the same.

We hope you find the Map Distance Dimension Line shape both useful and instructive!

Download “Visio Map Distance Dimension Line (Visio 2002)”

s!Aj0wJuswNyXlhW4PuAjCKm6u0y9G – Downloaded 2059 times – 103.00 B

A note for the future: in this article, we’ve made a shape that conforms to the scale of an imported image. It would be nice to create a utility that satisfies the counterpart to this case. We could use a utility that scales an image to match the size of a known shape!

  • Tweet
  • More
  • Pocket
  • Share on Tumblr
  • Print
  • Email

Related posts:

  1. Map of Europe
  2. Map of North America
  3. Visio Advent Calendar
  4. Off-center Radial Fill Effect
  5. Visio Microphone Shape

Filed Under: Add-ins & Tools, Maps & Geography, Shapes Tagged With: Dimension Lines, Formulas, Maps, Scale, ShapeSheet, SmartShapes, Tools

Previous Post: « Month Math
Next Post: 3D Extruded Map of USA »

Reader Interactions

Comments

  1. Jonathan says

    July 13, 2007 at 4:26 pm

    What, no spline support?

  2. Visio Guy says

    July 13, 2007 at 4:37 pm

    Splines, well…um…er…hard to calculate the length of a spline in the ShapeSheet, although I suppose it may be possible…ask your Dad at the next family barbecue! And wait a second, aren’t splines so early-90s? All my friends are NURB’n it these days.

  3. Tod says

    December 11, 2007 at 11:15 pm

    I am looking for a way to determine the length of a Freeform Tool line. I use the tool a lot when documenting Operator and Product flow diagrams. I want to be able to measure the distance travelled. FYI, I am using Visio Pro 2007. I have tried the Shape Area and Perimeter tool and it appears to be accurate, but I am not positive.

  4. Visio Guy says

    December 12, 2007 at 6:37 am

    Hi Tod,

    If you are able to use VBA or .NET, you can determine the length of a curve in Visio using the LengthIU method. I have an article about it here:

    LengthIU Bug Work-around Code

    The article discusses a problem that has been fixed in Visio 2007, but there is info about the function that might be useful to you.

    – Chris

  5. Matt says

    February 21, 2008 at 2:16 pm

    Hello, I am very interested in scaling images for the following reason. I am a crime scene investigator who makes diagrams of scenes for court and documentation purposes. I am most satisfied with my diagrams when they are scaled or close to scaled. I take a slew of measurements at scenes of buildings and objects around the area. What I would like to do is use an ariel image of the site and then scale the image to the known measurements. This would allow me to “trace” all of the other objects in the image and not hassle with sizing each line and shape accordingly. Any help would be appreciated.

  6. Adrian says

    October 19, 2009 at 8:24 pm

    Excellent tool, wish it had more than 3 leg max though.

  7. DC Kelley says

    March 30, 2010 at 6:05 am

    Any chance this can be issued in a version that visio 2002 users can make use of?

  8. Visio Guy says

    March 30, 2010 at 10:43 am

    Hi DCK,

    I’ve e-mailed you a 2002 version.

    If anybody else needs this, post a comment and I’ll upload it if demand shows the need!

  9. Steve Stoddart says

    March 1, 2011 at 11:07 am

    Greetings, Visio Guy,

    As requested by Adrian, is there likely to be a version that can handle more than 3 hops? I can enter the number I need in the Custom Properties dialogue but the actual number available does not increase beyond 3…

    Cheers

    Steve

  10. MJacobs says

    December 29, 2011 at 11:20 am

    Hi Visio Guy,

    Nice tool…I use it to measure cable distances in buildings.
    I’m just wondering if it’s possible to decrease the accuracy of the textual figure.
    Eg.I would like the distance 3,4516ft to show as 3,4ft.

    Hope there’s a simple solution to this wish 🙂

    Regards,
    Martijn

  11. Linda Allen says

    August 1, 2014 at 9:29 pm

    I am using Visio 2010 and cannot find a way to measure the actual length of a line drawn with the free form line tool. I used a proprietary program that ran under Visio 2002 that had a macro to do this, but cannot find a way to measure it in Visio without the macro. The lines I need the length of (in the scale currently being used for each diagram) have many turns and the 3 segment limit in what you speak of above won’t come close to handling it. Thanks!

  12. Visio Guy says

    August 3, 2014 at 12:04 pm

    Hi Linda,

    Visio 2010 has a ShapeSheet function that does this. Say you have a shape with a single geoemtry path.

    Under the hood, in the ShapeSheet, that path will be called “Geometry1”.

    You can then do this:

    1. Select the Shape
    2. Inset > Field
    3. Custom Formula
    4. Enter: =PATHLENGTH(Geometry1.Path
    5. Optionally specify some Data Format… options
    6. Hit OK

    The length of the path should show as the shape’s text–even when you change the shape!

  13. N128AV says

    October 13, 2014 at 3:58 pm

    How can you change the precision of the units?

    2405′ vs 2405.7775′

  14. Visio Guy says

    October 13, 2014 at 5:54 pm

    Hi N128AV,

    1. Select the map shape.
    2. Go to Insert > Text > Field on the ribbon/
    3. Category “User-defined Cells”, and Field name “dTotalScaled” should be selected.
    4. Click Data Format…
    5. Select “Number” from the Category list.
    6. Set Decimal places to 4, and choose other options below.

    You can double-click the “Map Dimension” master in the Document Stencil to make this edit once, then all shapes will have the updated behavior when you drop the edited master onto a drawing page.

  15. ROB says

    April 3, 2015 at 7:41 am

    Thanks very much for this Vision Guy, I am using this for calculating loom lengths for boat wiring schematics and Morse control cable lengths, its very useful but could do with more than 3 control points.

    Thanks Rob

  16. Ibolya says

    November 26, 2015 at 5:06 am

    Hi Ed,I read your post on Kathleen’s Weblog – Word Content Control.Would you mind sharing your code to romvee ’empty’ cc’s before printing a word template/document?ThanksJoyce

  17. Telengr says

    March 5, 2017 at 5:30 pm

    I needed a map path with curves and unlimited segments so I created a Mapline shape that displays the Total Length and has additional Distance Notes that can be placed along the map. It does not have some of the bells and whistles that VisGuy’s shape has but it some may find it useful.

    Visio Guy » Visio » User-submitted Stuff » Map Line Shape

    http://visguy.com/vgforum/index.php?topic=7702.msg32744#msg32744

Leave a Reply Cancel reply

Primary Sidebar

Buy Text on a Circle Shape
Article — Video — Purchase

Categories

Buy my book!

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tag Cloud

A/V Artistic Effects BPM Code Connectors Control Handles Countries Custom Patterns Custom Properties Data Graphics Data Linking Data Visualization David Edson David Parker Fill Format Formulas Functions Geometry Gradient Images Links Maps Multi-shapes Network Programming repeating shapes Resources Right-Click Actions Scale Shape Data ShapeSheet ShapeSheet Formulas ShapeSheet Functions SharePoint shiny SmartShapes Sport Sports Text Themes Tools Transparency User-defined Cells Visio 2007 Visio SmartShapes

Top Posts & Pages

  • - Visio Shapes & Stencils
  • - Visio Templates & Drawings
  • Bubble Revision Shapes
  • Visio Network Server Shape Icon Customization Tool
  • Sankey Diagram Shapes for Visio
  • Amazon AWS Visio Shapes
  • Dynamic Updating Org Charts in Visio!
  • Go 3D with Free Isometric Piping Shapes for Visio
  • Text to the Bottom of the Shape
  • Map of World

www.visguy.com - Visio Guy - since 2006

 

Loading Comments...