|
If you want to know what goes on behind the scenes when you work with Visio 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 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.
Figure 21-9: When you drag a shape from a stencil onto the drawing page, Visio places a copy of the master on the document stencil.
Inheritance is a weird fact of Visio 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 users and know that the shape will look right on the other user’s computer. Inheritance also explains why when you ungroup a shape created from a master, a dire-sounding message appears: “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 shape is no longer an instance of the master. That severed master, however, remains on the document stencil. Only the link to the master has been removed.
To remove masters from a document stencil that are no longer linked to 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 if you’re intending 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.
Figure 21-10: You can clean up a document stencil by deleting unneeded masters. If a master is still linked to a shape on the page, Visio warns you.
If 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 and are used by Visio to index shapes for searching. Keywords are an option in the Master Properties dialog box. For details, see “Editing Masters,” page 621. Visio 2003, unlike previous versions of Visio, 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.
Tip | Associate keywords with your custom stencils You can also assign keywords to your custom stencils. Searching for shapes will also pull up these stencils. To do so, 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 2003 you can drag any shape that you wish to save onto any open custom stencil, as Figure 21-11 shows. If the stencil is open as read-only, Visio asks you whether you want to open the stencil for editing, and if you click Yes, Visio 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 edit it only if you remove the read-only status by browsing to the file in Windows Explorer, displaying the file’s properties, and clearing the Read-Only check box.
Figure 21-11: You can drag a shape onto any stencil to open the stencil for editing and save the shape as a master.
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.
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. You can instead go to the source and edit the master.
Tip | You can create a master from an object that you have pasted or imported into the Visio application from another program. |
As if Visio 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 opens the master in its own drawing page, as Figure 21-12 shows. To close the window and save your changes, click the Close button in the master drawing window.
Figure 21-12: When you double-click a master, Visio opens the shape in the master drawing window. Often, the drawing page is sized to the shape.
In the master drawing window, you can edit the master as you would any other Visio 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 button in the master drawing window. If you have made changes to the master, Visio prompts you with a message like the one shown in Figure 21-13. When you click Yes, Visio saves your changes and revises the master icon to match, if necessary (although you can disable this action).
Figure 21-13: When you click the Close button in the master drawing window, Visio prompts you to save your changes with this message.
The 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 original or modified Visio masters.
What you can do if you’re in the business of creating and selling shapes is copyright your own. Shape copyrights are displayed in the Special dialog box (Format, Special). 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 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:
On a custom stencil that’s open for editing, right-click a master shape, and then choose Edit Master, Master Properties.
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.
Click OK to close the Master Properties dialog box.
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.
Option | Description |
---|---|
Name | The master name that will appear with the master icon on the stencil. You can type up to 31 characters, but shorter is better. Visio truncates long names (exactly where depends on the screen resolution). |
Prompt | The text that appears in the balloon when you point to a master shape on a stencil. Visio masters use this text to explain a shape’s purpose, but anything you think is useful information can go here. |
Icon Size | The size of the master icon on the stencil. The number in parentheses is the size in pixels. Normal is the setting Visio master shapes use. |
Align Master Name | How the master name is aligned with respect to the master icon. Visio master shapes use the Center setting. |
Keywords | Words that help users find shapes. Unless you’re planning to distribute your stencil, you can probably ignore this. The Find Shapes command uses the words you type in this box to help users locate shapes. Separate each keyword with a comma. This field is not available if the master drawing page contains no shape. |
Match Master By Name On Drop | An option that tells Visio whether to link the instance of a master to the master on the document stencil with the same name. Visio master shapes do not use this setting. If this check box is not selected, Visio uses the master’s timestamp to determine whether the master needs to be copied to the document stencil. |
Generate Icon Automatically From Shape Data | An option that tells Visio whether to re-create the master icon each time you save a change to the shape in the master drawing window. |
New Feature 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.
Tip | 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. |
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 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 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.
Figure 21-14: You can design a master icon, pixel by pixel, in the icon editor, which includes basic tools for setting pixel color.
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 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:
On a custom stencil that’s open for editing, right-click a master, and then choose Edit Master, Edit Icon Image.
Visio opens the icon editing window, displays the icon, and adds a toolbar with commands for editing the icon.
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.
After you’ve edited the icon, click the Close button to close the editing window. When Visio prompts you to save the changes to the stencil, click Yes.
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 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 displays for all master shapes. By default, Visio 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 displays master shapes and icons, all stencils you subsequently open are affected.
Follow these steps to change how master shapes are displayed:
Close any drawing files that you have open.
Choose File, Shapes, and select a stencil file.
Right-click the stencil title bar, and then select View. Choose Icons And Names, Icons Only, Names Only, or Icons And Details. Visio 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 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 opens the new stencil in a docked window that’s open for editing. If nothing else is open in Visio when you create a new stencil, Visio displays the stencil in a stencil window and displays menus for working with stencils and masters, as Figure 21-15 shows.
Figure 21-15: When you create a new, stand-alone stencil, Visio opens the stencil in a stencil window. The document’s drawing page is closed.
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.
Tip | 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 stencils are stored at C:\Program Files\Microsoft Office\Visio11\1033\. Click the Open button’s drop-down arrow, choose Copy, and then click Open. |
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 2003. You can make a copy of the stencil, as detailed 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 “Saving and Opening Read-Only Stencils,” page 613. The default location to which Visio 2003 saves stencil files is C:\Documents and Settings\<user>\My Documents\My 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 to that path. To set the default file paths that Visio searches for stencil files, choose Tools, Options, Advanced, and then click the File Paths tab. To add your path to the default shown in the Stencils box, click the 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 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:
Choose File, Shapes, Document Stencil to display the drawing file’s document stencil if it is not already visible.
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.
To clean up the file before you save it, delete all the shapes from the drawing page.
Tip | A quick way to remove all shapes from the page is to choose Edit, Select All, and then press Delete. |
Choose File, Save As.
In the Save As Type list, select Stencil. Type a file name and specify the location you want.
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.
Cross-Reference | For details about read-only stencils, see “Saving and Opening Read-Only Stencils,” page 613. |
Click Save to display the Properties dialog box, in which you can type information about the file if you want. When you click OK, Visio saves the document as a stencil that you can open with other drawings.
Tip | You may also click the Shapes button on the Standard toolbar, and choose a new stencil. Drag the shapes you wish to save from the document stencil to the new stencil and save them. |
|