![]() |
![]() ![]() |
|
Global Variables in VisioA drawing page has a ShapeSheet of it's own.Shapes can reference cells in this sheet just as they can reference cells in each other's ShapeSheets. Some drawing page cells that are useful right off the bat. For instance, you can create a frame or border shape that automatically stretches to the size of the page by referencing page cells such as: ThePage!PageWidth and ThePage!PageHeight.
You can create custom "global" variables by adding Custom Properties or User cells to a drawing pages ShapeSheet. Once youve created a Custom Property or User variable in the page, any shape can reference it. ![]() This shape has its width and height set with a factor referencing the variable set in the page ShapeSheet (see below). Width is set to ThePage!Prop.GlobalVar1*4 and height is set to ThePage!Prop.GlobalVar1*8
Once a shape references a page variable, that page variable will travel with the shape. If you drag the shape to a new page (that doesnt have the page variable), Visio will create the page variable in the new page, so that the shapes reference doesnt get broken. If a shape is dropped on a page that already has a page variable, then the shape will pick up the existing value it wont overwrite an existent page variable with a new one. This is usually desirable behavior. Caution: It is possible to have page variables collide, if they are named the same, but have different functions. You can imagine one solution where Prop.X=1in., and another where Prop.X="Red". If a shape expecting to reference the page and get a value like 1 in. but gets "Red" instead, the results might be somewhat unexpected. You can use Custom Properties or User cells as page variables. With Custom Properties, a user can right-click on the page, choose Shape.Custom Properties from the shortcut menu, and change the page variables herself. If you dont want your users mucking with page variables (perhaps you have an add-on or VBA code that changes the page variables automatically) then User cells make a better choice. A combination of the two can work well. Create user cell on the shape to reference a Custom Property on the page. Thus, the user cant easily change the individual shape, but can make global changes by accessing the pages properties.
|
|
|
Copyright © 1998-2007 DBM & others | Disclaimer | Privacy | Re-publication | Trademarks | Webmaster | Home |