Creating Shapes that Never Scale

3 4

You can create antiscaled masters; that is, shapes that are the same size in page units for all drawing scales. For example, a title block in an architectural drawing or a legend in a map should remain the same size regardless of the scale. To maintain the size of a title block shape, its dimensions must be converted to page units even though they are expressed in drawing units.

Microsoft Visio has two page formulas that allow you to determine the scale: ThePage!PageScale and ThePage!DrawingScale. You can write an antiscaling formula that uses the ratio of these two values to convert a value expressed in page units to its equivalent in drawing units.

To convert a page unit value into the equivalent drawing unit value, multiply by the following ratio:

 ThePage!DrawingScale / ThePage!PageScale 

If you write a custom formula for a master using this ratio, users can drag the shape into any drawing scale, and the shape's scale does not change. For example, to create a shape that is always 5-cm wide on paper and cannot be resized, enter this formula in the Shape Transform section:

 Width = GUARD(5 cm * (ThePage!DrawingScale / ThePage!PageScale)) 

If you want users to be able to resize the shape, do not use the guard function. When a user creates an instance from this master on a page that has a scale of 1 cm = 1 m, the Width formula is reevaluated for the scale of the destination page:

 = 5 cm * (1 m / 1 cm) = 5 cm * 100 = 500 cm 

When the shape is printed or displayed on the screen at actual size, Visio scales the 500-cm shape to 5 cm.

If you are creating a number of antiscaled masters, you might find it more efficient to store the antiscaling formula in a user-defined cell of the page sheet, such as ThePage!User.Antiscale. That way, you can quickly edit the antiscaling formula by changing values in only one place, the page sheet. The formula of any antiscaled master becomes:

 Width= 5 cm * ThePage!User.AntiScale 



Developing Microsoft Visio Solutions 2001
Developing Microsoft Visio Solutions (Pro-Documentation)
ISBN: 0735613532
EAN: 2147483647
Year: 2004
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net