Designing a Grid

By default, the Microsoft® Visio® drawing page displays a grid. If you design the scale of your shapes and drawing pages with the grid in mind, your users can quickly snap a drawing into place. Not all shapes need to snap to a grid, and not all templates require a customized grid. For most technical drawings, however, you should consider the grid when designing your masters.

For additional information about using grids in scaled drawings, see Chapter 12, Scaled Shapes and Measured Drawings.

In this section…

Setting the Grid for a Template's Drawing Page

Creating Masters that Work with a Grid

Using Formulas to hold Grid Information

Setting the Grid for a Template's Drawing Page

When you set up the drawing page in a template, you can decide whether the grid is variable or fixed. With a variable grid, the grid increments change as you zoom in and out. A fixed grid displays the same increments at every magnification. With either type, you can set how finely the grid and rulers are subdivided. In any view, users should be able to easily snap to a grid that works with the grid spacing used for the masters.

Grid settings you select in the Ruler & Grid dialog box are stored in the page's Ruler & Grid section in its ShapeSheet®. The variable grid settings are stored in the XGridDensity and YGridDensity cells. The fixed grid settings are stored in the XGridSpacing and YGridSpacing cells.

To set the grid spacing

  • On the Tools menu, click Ruler & Grid.

To show or hide the grid

  • On the View menu, click Grid.

To view a page's Ruler & Grid formulas

  • With nothing selected on the drawing page, click Show ShapeSheet on the Window menu, and then scroll to the Ruler & Grid section.

TOP

Creating Masters that Work with a Grid

If you design masters so their dimensions are multiples of an underlying grid spacing, users can take advantage of the snap-to-grid feature to drag shapes into precise positions quickly. When a user drags a master from the stencil, the instance is easily aligned on grid lines when dropped.

When snapping to grid lines is enabled, the edges of a two-dimensional (2-D) shape's alignment box snap to visible grid lines, showing the user the exact position of the shape. For a 2-D shape, the snap-to-grid action is most useful if both the width and the height of the shape are multiples of the spacing of the currently displayed grid, as the following figure shows. If this is not the case, opposite edges of the object snap separately, the dragging behavior of the shape is jerky, and the user must pay attention to whether the left or right edge snaps to the grid.

Designing a shape with width and height as multiples of the grid�s units

Designing a shape with width and height as multiples of the grid's units

  1. Width = 1 inch (4 * grid)
  1. Grid spacing = 1/4 inch
  1. Height = 1/2 inch (2 * grid)

To ensure that shapes snap to the correct position on the grid, masters should use the same units of measure as the drawing page. When you set up the drawing page for your template, specify the grid using the same units of measure as those used for the masters you design to be used with that template.

To set the units of measure for a master

  1. Right-click the master, and then click Edit Master to open the master drawing window.
  1. On the File menu , click Page Setup, click the Page Properties tab, and then select a Measurement units option.

To set the units of measure for a template

  • On the File menu, click Page Setup, click the Page Properties tab, and then select a Measurement units option.

If you want something other than a shape's edge to snap, you can adjust the shape's alignment box. For details about customizing the alignment box, see Using Alignment Boxes to Snap Shapes to a Grid later in this chapter.

Tip If you are designing two masters that are likely to be connected, position their connection points so that when the masters are both snapped to the grid and appear to be aligned, the connector will travel a straight path between the two closest connection points. For details about connection points, see Chapter 8, 1-D Shapes, Connectors, and Glue.

TOP

Using Formulas to hold Grid Information

To create masters based on a grid that you might later change, you can store the basic grid spacing used for a shape as a formula in a master. Grid spacing information isn't normally stored with masters, but by writing custom formulas, you can easily edit the masters in a stencil to work with different grids.

Creating formulas for a variable grid

When you're working with a template, you might change the document's units of measure. Doing so changes the document grid units, which in turn affects the way shapes snap to the grid. If you know a template's units of measure are likely to change, you can define the masters used in that template to work with different systems.

For example, you might want to adapt a template and stencil designed for a 1/4-inch grid for use with different measurement units, such as centimeters. If you've defined the width and height of the masters in the stencil in terms of a variable (specified in a user-defined cell) based on the grid spacing, you can simply change the variable for each master to reflect the new units of measure. When you do so, the masters are automatically sized to work with the new grid. You can name the user-defined cell so it's easy to understand its function.

For example, these formulas create a shape for a 1-cm grid.

User.GridUnit
Width
Height

= 1 cm.
= 6 * User.GridUnit
= 4 * User.GridUnit

You can specify any unit you want in the formula. The value is in drawing units, just like the cells of the Shape Transform section. To make the shape work in a grid based on inches, simply edit the value of the User.GridUnit cell and specify 0.25 in instead of 1 cm.

Creating formulas for a fixed grid

If your template's drawing page uses a fixed grid, you can define the shape formulas in terms of the grid spacing stored in the page; if the unit for the fixed grid changes in a new document, the shapes in the stencil automatically reflect the change. Instead of storing the grid spacing as a user-defined variable, the width and height formulas refer to the grid information in the page:

Width
Height

= 6 * ThePage!XGridSpacing
= 4 * ThePage!YgridSpacing