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.
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.
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:
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!
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!