Visio2000: How Units Are Expressed in a Formula Within the ShapeSheet (272731)



The information in this article applies to:

  • Microsoft Visio 2000 Enterprise Edition
  • Microsoft Visio 2000 Professional Edition
  • Microsoft Visio 2000 Standard Edition
  • Microsoft Visio 2000 Technical Edition

This article was previously published under Q272731

SUMMARY

To understand what makes a shape smart, it helps to know how shapes are drawn and stored. Every Microsoft Visio shape is described in its own ShapeSheet spreadsheet, which contains information about the shape's geometry and its other properties. This article discusses how units are expressed within formulas.

MORE INFORMATION

Visio evaluates the result of a formula differently, depending on the cell that you enter it in. In general, cells that represent shape position, a dimension, or an angle require a number-unit pair that consists of a number and the qualifying units needed to interpret the number. For example, a formula in the Width cell that evaluates to 5 means 5 units of measure, such as inches or centimeters. Many other cells are unit-less and evaluate to a string, to TRUE or FALSE, or to an index. For example, the formula =5 in the FillForegnd cell means color 5 from the drawing's color palette, and in the LockWidth cell means TRUE (and locks the shape's width).

Always specify a unit of measure when you enter a formula in a cell that expects a dimensional value. Doing so makes it easier to identify the number-unit pairs in your calculations, so that you do not inadvertently divide one number-unit pair with another number-unit pair, or combine incompatible units, such as adding angles to lengths. In addition, specifying units of measure makes it easier to localize your formulas to international use.

If you do not specify units of measure, Visio evaluates a number by using the default units defines for the cell, which can be page units, drawing units, or angular units. Page units measure sizes on the printed page, including typographical measurements. Drawing units specify the real-world measurement, such as a 50-meter pool (drawing units) that appears 10 cm long (page units) on paper. Shapes can also have angles that are expressed in units. The default formula for determining the rotation angle of a 1-D shape is =ATAN2(EndY-BeginY,EndX-BeginX) in the Transform section of the ShapeSheet. Angle formulas can be expressed in degrees, radians, Sin, Cosine, Gravity, and so on.

Sample Calculations Using Number-Unit Pairs

Do thisDon't do this
5 in.5
Width + 0.5 inWidth + 0.5
7 in. * 1.57 * 1.5
DEG(MODULUS(Angle, 360 Deg.))MODULUS(Angle, 360 deg.)


REFERENCES

For more information about the ShapeSheet, click Search on the Help menu, type shapesheet in the What would you like to know? box, and then click Search to view the topics returned.

Modification Type:MajorLast Reviewed:11/9/2000
Keywords:kbinfo KB272731