Creating Masters and Stencils

A master is a shape, multiple shapes, a group, or an object from another application that is saved on a stencil, which can be opened in other drawings. You can create a shape on the drawing page, and then drag it into a stencil to create a new master. Or you can use commands available in the stencil window to create a new master. As you design masters, keep in mind that a common design goal is to create masters that allow the user to create drawings without having to draw anything by hand.

To reuse the masters you create, you save them on a stencil, which is a file with the extension .vss (or .vsx for XML format). You can save any Microsoft® Visio® file as a stencil. Unless otherwise specified, the term stencil refers to a stencil file. Stencil files exist autonomously from drawing files and template files; a stencil might open with a template because the stencils are saved as part of the template's workspace, but a stencil can be opened alone or with any drawing.

When a user drags a master from a stencil onto a drawing page, the Visio engine creates a copy of that master on the drawing's document stencil and creates an instance of the master on the drawing page. A drawing file always includes a document stencil that contains copies of the masters used in the drawing, even if the corresponding shapes are later deleted from the drawing page. An instance is linked to the copy of its master on the document stencil and inherits its behavior and appearance from that master.

Because a stencil contains the shapes from which users of your solution will construct a drawing, it is a primary user interface element in any drawing solution. The arrangement of shapes on the stencil, as well as shape behavior and performance, are all important usability considerations.

By default, the stencils that ship with Visio open in the Visio application as read-only. For you to work with a stencil or the masters it contains, the stencil must be editable.

Note If you open the stencil while the drawing window is not active or no drawing window is open, the stencil opens as a stand-alone (in its own window). To make a stand-alone stencil editable, you must open the stencil file as Original.

When you open a template that includes stencils in its workspace, or if you open a stencil with an open drawing window that is active, the stencils open in anchored windows (either docked or floating). To make a stencil in an anchored window editable, click the icon on the stencil title bar, and then click Edit.

When a stencil in an anchored window is editable, a red asterisk appears on the upper-left corner of the icon on the stencil title bar.

Stencils in a Visio drawing file

Stencils in a Visio drawing file

  1. Typically, when you open a template, its stencils open as read-only in anchored windows.
  1. To display a document's stencil, on the File menu point to Stencils, and then click Document Stencil.

In this section…

Creating a Stencil

Creating Masters on Stencils

Editing Masters on Stencils

Creating a Stencil

One way to create a stencil is to open a new, empty file as a stencil. Because the new file's drawing page is empty, you can more easily keep file size to a minimum, and the file contains only the default styles until you add masters to the stencil.

To create a new, empty stencil file with write access

  • On the File menu, point to Stencils, and then click New Stencil.

If you plan to base a new stencil on an existing one, you can add new masters to the existing stencil or edit the ones already there, and then save the revised stencil as a new file.

To open an existing stencil with write access

  1. On the File menu, point to Stencils, and then click Open Stencil.
  1. Select the stencil file you want to revise.
  1. Click the arrow next to the Open button, click Original, and then click Open. Alternatively, you can click the icon on an open stencil's title bar, and then click Edit on the shortcut menu.

Note The stencils, masters, templates, and source code provided with Microsoft Visio are copyrighted material, owned by Microsoft Corporation and protected by United States copyright laws and international treaty provisions. You cannot distribute any copyrighted master provided with Microsoft Visio or through a Web-based subscription service, unless your user already has a licensed copy of Visio that includes that master, or your user has a valid subscription to the Web-based service, or you've signed an agreement that allows you to distribute individual masters to your users. This includes shapes you create by modifying or deriving shapes from copyrighted masters.

To copyright your original shapes, select a shape, click Special on the Format menu, and then enter copyright information in the Copyright box. After you enter copyright information in the Special dialog box, it cannot be changed in a drawing, stencil, or template file.

You can quickly create a new stencil with masters already in it by saving the document stencil of a drawing file as a stencil file with the .vss file name extension (or .vsx for a stencil in XML format). This stencil will contain all the masters used during the drawing session, including masters with instances that you have since deleted from the drawing page. To save the cleanest and most user-ready version of the stencil, edit the document stencil and clean up the drawing page before saving it as a new stencil file.

To create a new stencil from a drawing's document stencil

  1. On the File menu, point to Stencils, and then click Document Stencil to view or edit the masters before saving them.
  1. On the File menu, click Save As.
  1. For Save as type, click Stencil (*.vss) or XML Stencil (*.vsx). Enter a name and location for the file, and then click Save.

TOP

Creating Masters on Stencils

Just as you can drag a master into a drawing to create a shape, you can drag a shape or group onto a stencil to create a master. To begin, the stencil must be editable. You can make a stencil editable either by opening it as Original or by clicking the icon on the stencil's title bar, and then clicking Edit on the shortcut menu.

You can create a master from an object that you have pasted or imported into Visio from another program. You can also create masters by adding new, blank masters to a stencil.

To create a master from a shape in a drawing

  1. In the drawing window, display the page that contains the shape you want to use as a master.
  1. Make sure the drawing window is active, and then drag the shape from the drawing window into the stencil window. Or hold down CTRL to drag a copy of the shape. If the stencil is open as Read only, a message is displayed, and you can dynamically change the stencil to make it editable.
  1. To save your changes to the stencil file, click the icon on the stencil's title bar, and then click Save on the shortcut menu. If the stencil is in a stand-alone window, click Save on the File menu.
  • If you are creating a new stencil, type a new name for the stencil. In the
  • Save As
  • dialog box, for
  • Save as type
  • , click
  • Stencil (*.vss)
  • or
  • XML Stencil (*.vsx)
  • . To protect the stencil from accidental changes the next time it is opened, click the arrow next to the
  • Save button
  • , and then click
  • Read only
  • .
  • Click
  • Save
  • .

To create a new, blank master

  1. Open a stencil.
  • If the stencil to which you want to add the master is not editable, click the icon on the stencil's title bar (if the stencil is in an anchored window), and then click
  • Edit
  • on the shortcut menu.
  • Alternatively, you can make a master editable by reopening the stencil as
  • Original
  • .
  1. Right-click anywhere on the stencil window, and then click New Master on the shortcut menu.
  1. In the New Master dialog box, for Name, type a name for the master, and then click OK.
  • For details about other options in the
  • New Master
  • dialog box, click the
  • Help
  • button in the dialog box.

TOP

Editing Masters on Stencils

When you open a stencil with write access, you can edit the masters by opening the master drawing window as the following figure shows. To specify the attributes of masters and icons, right-click the master and choose commands from the shortcut menu.

The master drawing window displays the drawing page for a master.

The master drawing window displays the drawing page for a master.

  1. The red asterisk on the icon in the stencil title bar indicates that a stencil in an anchored window is editable.
  1. You can add a new, blank master to a stencil, and edit the master and its icon.
  1. You can rename a master quickly by double-clicking the master's text.
  1. You can draw and edit on the master's drawing page using the same techniques you use on the document's drawing page.

To edit a master

  1. In the stencil window, right-click the master you want to edit, and then click Edit Master on the shortcut menu.
  1. When you are finished editing the master, close the master drawing window.
  • If you've made any changes to the master, a message appears asking if you want to update the master. Click
  • Yes
  • . The master icon is also updated to reflect the changes you have made, unless the
  • Generate icon automatically from shape data
  • check box is cleared in the master's
  • Master Properties
  • dialog box.