Layers are essential in multiple-page drawings or diagrams that contain many shapes. Layers help you organize related shapes on a drawing page so that you can work with and view shapes according to their layer assignment. For example, you can create a detailed drawing that includes electrical outlets, computer networking details, furniture layouts, and more and then use layers to display selected information. When you want to rearrange the furniture, you can hide electrical outlets and computer networking details. And when you're most interested in your drawing's electrical outlets, you can hide everything else. Not only does this help you see the big picture electrically, but it keeps you from rearranging other objects accidentally, such as furniture, when you're positioning those outlets. You can hide, lock, print, count, snap, or glue shapes based on their layer assignment.
Layers may not be what you think they are based on your experience with other layout or design programs. Visio layers are not stacking order. Layers don't control which shapes appear in front and in back. Layers don't really work like stacks of transparencies. They're more of a concept for grouping or cataloging shapes. Technically, a layer is a named category to which you can assign shapes. For example, you can create a Furniture layer in a floor plan. The layer doesn't do or mean anything unless you assign a shape to it. Let's say you assign all the desks and chairs to your Furniture layer, but not the walls and cubicle panels. Now the layer becomes useful. For example, you can hide all the shapes on the Furniture layer to make it easier to work with just the walls.
Besides hiding and showing shapes, layers can be used to protect your work. You can lock a layer so that none of the shapes assigned to it can be edited. And unlike other applications, Visio lets you assign a shape to more than one layer. Those cubicle panels can belong to both a Walls layer and a Moveable Furniture layer. Because layers are the property of a drawing page, in a multiple-page drawing, the layers you create for one page don't appear on any other pages—but if you need them to, see "Using Layers in Multiple-Page Diagrams."
You don't necessarily have to create layers to take advantage of them. When you start a diagram with a Visio template, you might find that your drawing already includes layers. Many Visio masters are already assigned to layers, so when you drop them onto the page, the layer is added as well. For example, when you open the Office Layout solution, the masters are already assigned to layers. As you drop instances of the masters, the layers are created automatically. A room shape is assigned to the Spaces layer; its dimension lines are assigned to the Dimensions layer; and the outline of the space is assigned to the Building Envelope layer. The Layer box on the Format Shapes toolbar displays the layer to which a selected shape is assigned, as Figure 16-37 shows. If the shape is assigned to more than one layer, Multiple Layers is displayed in the Layer box.
Figure 16-37. In an office layout diagram, the Format Shapes toolbar displays the layers to which selected furniture shapes are assigned—in this case, the Movable Furnishings layer.
Follow these steps to select all the shapes on a layer:
Visio selects the shapes assigned to the layer.
Layers in Visio differ from layers or levels in CAD programs in some key ways. Think of layers as an organizing principle rather than stacked sheets of paper or Mylar sheets on a drafting table. Because they're used to organize, Visio layers don't affect which shapes appear in front or in back. They can offer different views of a diagram inasmuch as you can hide and show shapes according to the layer they're assigned to. Here are several basic truths about Visio layers that often surprise CAD users:
You can see all the pages in your diagram, including all the shapes and layers on each page, in the Drawing Explorer window. To display it, choose View, Drawing Explorer Window. To see details about pages and layers, double-click the Foreground Pages folder, and then double-click the page you're currently working on (or Page-1 if you haven't added or renamed any pages). Double-click the Layers folder. If nothing happens, your drawing contains no layers. Otherwise, Visio lists all the layers on the page. If you expand a layer, you can see all the shapes assigned to it, as Figure 16-38 shows.
Figure 16-38. You can see all the layers on a page—as well as all the shapes assigned to that layer—in the Drawing Explorer window.
In the Drawing Explorer window, you can quickly make a layer visible or active: right-click the layer, and then select the option you want. You can also delete layers with this method (which does not delete the shapes on the layer). When you make a layer active, each shape you subsequently add to the diagram is assigned to that layer automatically.
You can create your own layers to add to the ones Visio supplies or add layers to a drawing that doesn't include them already. When you create a new layer, it is added to the current page only, not to other pages in your diagram. You can define new layers as you insert new pages into a diagram. Or, you can just copy shapes with layer assignments from one page to the new page—when you paste the shape, any layers it's assigned to are added to the new page. Visio is smart enough to know if the page already has a layer with the same name and adds the shape to the existing layer.
Follow these steps to create a new layer:
For example, if you check Active, all shapes you subsequently add to the diagram are assigned to the new layer automatically (until you designate a different active layer.)
Of course, layers are only useful if some shapes have been assigned to them. You can assign a shape to more than one layer, or you can leave a shape unassigned. To assign an individual shape to a layer or layers, follow the steps.
If the Format Shapes toolbar is visible, you can select a shape, and then select a layer from the drop-down list in the Layer box.
Many master shapes are already assigned to layers, but you can change those assignments. This is worth doing if you frequently use shapes from a Visio stencil that are preassigned to layers you don't use. For example, if you find yourself creating the same new layer every time you start a new office layout, consider adding your layer directly to the masters you're using. Let's say you always assign panel shapes to a Cubicle layer. You can save your edited panel shape on the Office Layout stencil, effectively creating a new master panel shape with your Cubicle layer. Every time you add that shape to a drawing page in the future, the Cubicle layer is added to the page.
As an alternative, you can edit one of the existing masters to reassign its layers. To do this, right-click a stencil title bar, choose Edit, and then edit any of the master shapes. You can then save your changes as a new stencil or with the original stencil.
When you edit a master shape, Visio opens a master drawing page and displays all the commands that apply, including Format, Layers (where you can assign the master to a new layer) and View, Layer Properties (where you can rename an existing layer). Editing masters is just like editing shapes once you're working in the master drawing window.
For details about how to open stencils and edit masters, see "Creating a New Stencil."
To assign a group to a layer, first group the shapes and then choose Format, Layer and select the layer to which you want to assign the group. All of the group members are assigned to the new layer, and their previous layer assignments are canceled. If you want the individual shapes to retain their current layer assignments, select the Preserve Group Member Layers check box in the Layer dialog box. For example, you might group a prep cart and a microwave oven and then assign the group to the Kitchen layer but also want the prep cart to remain on the Furniture layer and the microwave on the Appliances layer.
If you add a shape that doesn't already have a predefined layer assignment to a page, the shape is assigned to the active layer automatically. By making a layer active, you can quickly add shapes to a diagram and assign them to a layer all at once.
Tip - Make a Layer Active
If you keep the Drawing Explorer window open (choose View, Drawing Explorer Window) when you're working in a drawing with layers, you can quickly select the active layer by right-clicking a layer in the Drawing Explorer window, and then choosing Active.
To specify the active layer, choose View, Layer Properties, and then click in the Active column of each layer that you want to make active, as Figure 16-39 shows.
Don't bother to specify an active layer if you're only using Visio master shapes, such as those on the Walls, Doors And Windows stencil. They're already assigned to the correct layer anyway. If you don't specify an active layer, new shapes are not assigned to any layer unless you're using a master shape with a built-in layer assignment.
Figure 16-39. Click in a layer's Active column to make it the active layer. More than one layer can be active at a time. You can't make a locked layer the active layer.
After you have assigned shapes to a layer, you can work with them as a group. You can lock them against editing, hide them temporarily from view, set entire layers to not print, and determine whether other shapes can snap or be glued to them. For example, while you're adding furniture to an office layout, you might want to disable snapping for all the shapes on the Power/Comm layer so that desks don't snap to electrical outlets. Then, you can disable printing for all the shapes on the Furniture layer to print a copy of the diagram that shows only the walls and wiring.
To specify options for each layer, you must work in the Layer Properties dialog box, as shown in Figure 16-40. You can open the Layer Properties dialog box in several different ways, depending on which windows and toolbars are available:
Figure 16-40. To work with all the shapes assigned to a layer, choose View, Layer Properties, and then click in a column to enable an action, such as Snap, for a layer.
Table 16-7 describes the options that are available for shapes assigned to layers.
Table 16-7. Options for Layer Properties
When checked, all the shapes assigned to the layer are displayed. Uncheck to temporarily hide shapes.
When checked, shapes assigned to the layer appear when you print the page. When unchecked, shapes assigned to the layer won't be printed, a useful technique when you want to print different parts of a drawing for different audiences. If a shape is assigned to multiple layers, you must cancel the Print option for every layer the shape is assigned to for the behavior to work.
When checked, makes the layer the active layer. For details, see the previous section, "Working with Active Layers."
When checked, shapes assigned to the layer cannot be selected, moved, or edited, and the layer cannot be set as Active. You cannot add shapes to a locked layer.
When checked, you can snap shapes to the shapes assigned to the layer. When unchecked, the shapes assigned to the layer cannot be the target of snapping, although the shapes themselves still snap. If a shape is assigned to multiple layers, you must cancel the Snap option for every layer the shape is assigned to for the behavior to work.
When checked, you can glue shapes to the shapes assigned to the layer. When unchecked, the shapes assigned to the layer cannot receive connections (that is, other shapes cannot be glued to them), but any connectors on the layer can still connect and glue to other shapes. If a shape is assigned to multiple layers, you must cancel the Glue option for every layer the shape is assigned to for the behavior to work.
When checked, the Layer Color list box appears in the Layer Properties dialog box, and all shapes assigned to the layer are highlighted in the selected color. Each layer for which this option is selected can be displayed in a different color. The color temporarily overrides the shape's original color. If a shape is assigned to multiple layers, it always appears in its original color unless you specify the same color for each layer to which the shape is assigned.
In many diagram types with multiple pages, a repeating element can appear on all pages. Maybe it's something as simple as a corporate logo or title block. You can place such elements on a background page and then assign that background to every foreground page on which you want it to appear. In technical drawings, you can get even fancier with background pages and use them to organize, hide, and reveal elements on multiple-page diagrams. To do this, you assign background shapes to layers. Because a background can be shared by more than one page, so, too, can its layers—this is a critical point, because layers can't be used on more than one page.
For example, in an office layout where the same room outline is used on multiple pages, you can put the walls and moveable panels on the background, and then use different foreground pages to display furniture layouts, electrical wiring, network cabling, and so on. If you assign the wall shapes to one layer on the background and the panels to another, you can hide the moveable panels on all the pages that display the background whenever you need to see only structural elements.
You can also use background layers as a way to protect information that shouldn't be modified, such as the project's permit number or a company logo. To do this, create a new layer (for example, the Permanent layer), assign these shapes to the layer, and then lock the layer with the Layer Properties command on the View menu. You can then pass the file to others without risking any change.