If you want to know what goes on behind the scenes when you work with Visio 2007 shapes, this section is for you. This information is useful primarily if you plan to create new shapes and save them for reuse as master shapes. Each master has an internal timestamp that records the date and time it was last updated. When you drag a master onto the drawing page, Visio 2007 uses its timestamp to determine whether to make a copy of the master on the document stencil. An instance or copy of the master appears on the drawing page, as Figure 21-9 shows. 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 on the drawing page is linked to the copy of the master on the local stencil and inherits its behavior and appearance from that master. If you create a shape using the drawing tools, the shape is not linked to any master or the document stencil.
Inheritance is a weird fact of Visio 2007 life that keeps file management efficient and makes shapes reusable. Because of inheritance, you can quickly reformat all the instances of a master shape that you’ve already added to a drawing page by editing the copy of the master shape on the document stencil. You can also share shapes with other Visio 2007 users and know that the shape will look right on the other user’s computer. Inheritance also explains why ungrouping a shape created from a master results in a dire-sounding message: “This action will sever the object’s link to its master.” This simply means that the shape on the page will no longer inherit from the master stored on the document stencil—that is, the ungrouped shape is no longer an instance of the master. That master, however, remains on the document stencil. Only the link from the ungrouped shape to the master has been removed.
To remove masters from a document stencil that are no longer linked to any shapes on the page, you can display the document stencil and delete them manually. You can’t tell by looking whether a master on the document stencil is linked to a shape instance on the drawing page, but if you try to delete a master that is still linked, you see the message shown in Figure 21-10. About the only time it’s worth cleaning up a document stencil is when you intend to save a drawing as a template and you want the drawing page and document stencil to be as small as possible in terms of file size.
Troubleshooting: The Find Shape tool does not locate master shapes that have been customizedIf you create your own master shapes and want them to appear when you are searching for shapes, you must include keywords with the master shape. The keywords correspond to the search text users type in the Search For Shapes box in the Shapes window. They are used by Visio 2007 to index shapes for searching. Keywords are an option in the Master Properties dialog box. For details, see the section titled “Editing Masters” later in this chapter. Visio 2007, unlike versions of Visio prior to Visio 2003, searches your entire hard drive and the Internet by default. Hence it will find a stencil or shape that contains the keyword you typed in the Search For Shapes box no matter what the stencil’s file path is. |
Note
You can assign keywords to your custom stencils. Searching for shapes will also pull up these stencils. To assign keywords to your custom stencils, open the stencil for editing (right-click the stencil and select Edit Stencil), and then right-click the stencil and select Properties. Type the keyword that you wish to associate with the stencil in the Keywords box.
In Visio 2007, you can drag any shape that you wish to save onto any open custom stencil, as Figure 21-11 shows. Visio 2007 creates a default master. That’s the quickest way to create a master and save it on a stencil. You can then edit the master and its icon, as described in the next section. Note that in this instance a read-only stencil is a custom stencil that has not been opened for editing. If the file was previously saved as a read-only file, you can only edit it if you remove its read-only status. (To do this, browse to the file in Windows Explorer, display the file’s properties, and clear the Read-Only check box.)
There are other ways to create a new master as well. You can do the following:
Open a custom stencil for editing; add a new, blank master; and then create a shape. There might be an advantage to working this way (you get the same effect by creating your shape on the drawing page and then dragging it onto a stencil). The advantage is that if you intend to use the shape frequently in your drawing, you can drag it straight from the master stencil.
Open a custom stencil for editing, edit an existing master, and then save your changes. This method is especially handy when you use a particular shape all the time and always edit it in the same way. Instead of editing the shape many times, you can go to the source and edit the master.
Note
You can create a master from an object that you have pasted or imported into the Visio 2007 application from another program.
As if Visio 2007 didn’t have enough windows and panes already, the master drawing page window is the place where you can edit masters. To display this window, double-click a master on a custom stencil that’s open for editing. Visio 2007 opens the master in its own drawing page, as Figure 21-12 shows. To close the window and save your changes, click the Close icon in the master drawing window.
In the master drawing window, you can edit the master as you would any other Visio 2007 shape. You can drag shapes from other stencils, draw or edit with the drawing tools, or paste an object from another application. The only difference is in how you save your changes: Click the Close icon in the master drawing window. If you have made changes to the master, Visio 2007 prompts you with a message like the one shown in Figure 21-13. When you click Yes, Visio 2007 saves your changes and revises the master icon to match, if necessary (although you can disable revisions to the icon).
Copyrighting MastersThe masters supplied by Microsoft Corporation are copyrighted. You are legally permitted to copy, modify, and reorganize them for your own use, and you can distribute drawings that contain them. However, you cannot legally sell or distribute the original or modified Visio masters. What you can do if you’re in the business of creating and selling shapes is create your own from scratch and copyright them. Shape copyrights are displayed in the Special dialog box. Select Format, Special (choose Tools, Options, select the Advanced tab, and turn on the Run In Developer Mode check box to access this menu command). The Copyright field is a one-shot deal: Once you type your copyright information and click OK, you can’t edit the field’s value. |
Visio 2007 creates an icon and default name for new masters, both of which you can change. For example, if you create a new master by dragging a shape onto a stencil, the master icon is a rectangle with a miniature image of the shape and a label “Master.n,” where n is the number of shapes on the stencil. A master has properties that include its icon size, name, and prompt—the text that appears on the status bar when you point to a shape on a stencil. You can also specify how icons are displayed and aligned on a stencil.
To edit a master’s properties, follow these steps:
1. | On a custom stencil that’s open for editing, right-click a master shape, and then choose Edit Master, Master Properties.
| ||||||||||||||||
2. | In the Name box, type the name of the master shape as you want it to appear on the stencil. Table 21-1 lists the other options that you can specify.
| ||||||||||||||||
3. | Click OK to close the Master Properties dialog box. | ||||||||||||||||
4. | To save your changes, right-click the stencil’s title bar, and then choose Save. Or if the stencil is open in a stand-alone window, choose File, Save. |
Save icon
After you make a change to a custom stencil, the Save icon appears in the stencil title bar. Click the icon to save the changes.
Note
The Master Properties command is available only when you right-click a master on a custom stencil that’s open for editing. To edit a custom stencil, click the stencil’s stencil icon (or right-click the title bar) and select Edit Stencil.
Stencil icon
If you create and distribute master shapes on a custom stencil, well-designed, well-organized icons provide a nice touch. The master icon is a user’s first clue about a shape’s purpose. Although Visio 2007 creates and arranges master icons as you add new masters to a stencil, you’ll probably want to refine both their look and location.
There is a fine art to designing meaningful images in a space of 32 by 32 pixels, the default size of a master icon. If you want to design or edit the master icon on a stencil, you can work, pixel by pixel, in the icon editor. Visio 2007 typically creates an icon for you based on the appearance of the shape in the master drawing window. You can then refine the icon in the icon editor to change its shape and colors, as Figure 21-14 shows. Here’s the trick: Select the Pencil tool and click the left mouse button to apply the Left Button Color to a pixel—likewise for the Right Button Color and the right mouse button. Select the colors on these buttons, and then left- and right-click with the Pencil tool to draw in the icon editor.
Icons can be larger than 32 by 32 pixels. Their size is set in the Master Properties dialog box, as explained in the previous section. The Icon Size you specify there determines the size of the area in the icon editor.
Note
If you plan to design a unique master icon, make certain to clear the Generate Icon Automatically From Shape Data check box in the Master Properties dialog box as well. Otherwise, Visio 2007 will overwrite your icon every time you edit the master in the master drawing window.
Follow these steps to edit a master icon in the icon editing window:
1. | On a custom stencil that’s open for editing, right-click a master, and then choose Edit Master, Edit Icon Image. Visio 2007 opens the icon editing window, displays the icon, and adds a toolbar with commands for editing the icon. |
2. | Use the tools to change the colors and shape of the icon. As you change the icon, your changes are reflected on the stencil. You might need to rearrange the windows to see both the stencil and icon editor windows. |
3. | After you’ve edited the icon, click the Close icon to close the editing window. When Visio 2007 prompts you to save the changes to the stencil, click Yes. |
4. | If the results are disappointing, choose Edit, Undo Change Icon. Or press Ctrl+Z. You can also use the Undo command while you’re working in the icon editor. |
In addition to editing or designing a master icon, you can change the order in which master shapes appear on a stencil and choose whether a name and description are displayed with the icon. For example, you can display a description next to the master shape icon that indicates the shape’s purpose. To change the order of the stencil’s icons, simply drag the master shape icons into position. Visio 2007 snaps the icons into alignment and creates rows and columns based on the size of the stencil window.
You can also choose how much information Visio 2007 displays for all master shapes. By default, Visio 2007 displays the master icon and shape name. You can instead display only the icon, only the name, or both with a description as well. When you change the way Visio 2007 displays master shapes and icons, all stencils you subsequently open are affected.
Follow these steps to change how master shapes are displayed:
1. | Close any drawing files that you have open. |
2. | Choose File, Shapes, and select a stencil file. |
3. | Right-click the stencil title bar, and then select View. Choose Icons And Names, Names Under Icons, Icons Only, Names Only, or Icons And Details. Visio 2007 changes the master shape display depending on the command you choose. |
It’s useful to create an entirely new stencil when you want to save shapes you create or consolidate masters from Visio 2007 stencils that you use frequently. To create a new, empty stencil file with write access, choose File, Shapes, New Stencil. If you already have a drawing file open, Visio 2007 opens the new stencil in a docked window that’s open for editing. If nothing else is open in Visio 2007 when you create a new stencil, Visio 2007 displays the stencil in a stencil window and displays menus for working with stencils and masters, as Figure 21-15 shows.
There are a couple of advantages to starting a new stencil in a new window:
Visio displays a toolbar with buttons for controlling the display of master icons in the stencil window.
The new stencil document’s drawing page is empty and its style lists include only the four default styles, so you’re starting with the minimum file size.
Note
To display the stencil’s drawing page, which provides a convenient work area while you add masters, choose Window, Show Drawing Page.
You can open other stencils, and then drag masters onto your new stencil, or you can create and design masters from scratch in the stencil window. Table 21-2 summarizes techniques for working with stencils.
Task | Technique |
---|---|
Create a new, empty stencil | Choose File, Shapes, New Stencil. |
Create a new stencil based on an existing stencil | Choose Open. In the Open dialog box, locate and select the stencil you want to use. Visio 2007 stencils are stored at C:Program FilesMicrosoft OfficeOffice121033. Click the Open button’s drop-down arrow and choose Open As Copy. |
Add a master from one custom stencil to a different custom stencil | Open both stencils, and then drag the master from one stencil to another. Note that you can no longer add a shape to a stencil that ships with Visio 2007. You can make a copy of the stencil as explained earlier, and then add a master. |
Save changes to a docked custom stencil that’s open for editing | Right-click the stencil’s title bar, and then click Save or Save As or click the Save icon in the stencil’s title bar. |
Save changes to a custom stencil open in a stencil window | With the stencil window active (click its title bar), choose File, Save or Save As or click the Save icon on the Standard toolbar. |
To save your changes, do one of the following:
If the new stencil is in a docked stencil pane, right-click the stencil’s title bar, and then choose Save.
If the new stencil is open in a stencil window, choose File, Save (or press Ctrl+S) or click the Save icon on the Standard toolbar.
To make sure that other users cannot open your stencil for editing, set the Read Only option in the Save As dialog box. For details, see the section titled “Saving and Opening Read-Only Stencils” earlier in this chapter. The default location to which Visio 2007 saves stencil files is C:Documents and Settings<user>DocumentsMy Shapes, where <user> is the user login name used when starting Windows.
You can also set up a folder on your computer for your customized stencils and then direct Visio 2007 to that path. To set the default file paths that Visio 2007 searches for stencil files, choose Tools, Options, Advanced, and then click the File Paths button. To add your path to the default shown in the Stencils box, click the browse (...) button to the right of the box, browse to the location where you wish to save files, and then click Select. You’ll return to the File Paths box. Click OK.
If you’ve been working in a drawing and want to save the masters that have accumulated on its document stencil as a new, stand-alone stencil, it’s easy. Basically, you save the drawing file as a stencil file. This can be a quick way to create a new stencil, but it can also result in a larger than normal file size. When you save a drawing file as a stencil file, Visio 2007 saves all the masters on the document stencil, but also saves any shapes you’ve left on the drawing page. When you next open the stencil file, it will open in the normal fashion—either docked or in a stand-alone window, depending on how you open it. The shapes left on the drawing page are still stored with the file and take up file space, but they’re not visible because the stencil’s drawing page is closed.
It’s best to delete the shapes from the drawing page when you want to save a drawing file as a stencil. Then only the masters on the document stencil are saved, which is really all you need if you plan to use the document as a stencil.
Follow these steps to save a drawing file’s document stencil as a new stencil:
1. | Choose File, Shapes, Show Document Stencil to display the drawing file’s document stencil if it is not already visible. |
2. | Make sure that the document stencil contains the masters you want. You can delete masters you don’t need, edit the master properties to change the master names, and drag master icons to arrange them in the order you want. |
3. | To clean up the file before you save it, delete all the shapes from the drawing page. |
4. | |
5. | Choose File, Save As. |
6. | In the Save As Type list, select Stencil. Type a file name and specify the location you want. |
7. | If you want to share your stencil with others but ensure that they can’t edit it, click the Save button’s drop-down list arrow, and choose Read Only. |
For details about read-only stencils, see “Saving and Opening Read-Only Stencils” earlier in this chapter.
Note
You can also click the Shapes button on the Standard toolbar, and choose New Stencil. Drag the shapes you wish to save from the document stencil to the new stencil and save it.