By
Allen V. Rouse MCSE, MCDBA, CCNA
Thursday, March 06 2003 12:00 PM
URL:
http://www.zdnetasia.com/insight/software/0,39044822,39117002,00.htm
Microsoft Visio comes with a variety of prefabricated shapes designed to
represent components such as servers and routers in your network diagrams.
You
simply drag and drop these shapes into your drawing to document your network.
But sometimes, the component you need isn't available and you have to draw your
own.
If you plan to reuse that component in other drawings, you can put it into
a custom stencil you create.
Recently, I wanted to document the port
assignments for my organization’s Cisco Catalyst 6509 switch, which contains
three “blades” with 48 ports apiece. Each blade has four 12-port modules. I
decided to draw just one 12-port module and put that shape into a stencil so
that I could reuse it at any time. I’m going to show you how I did it so that
you can see how to create your own custom stencils.
What is a stencil?
In Visio, a stencil appears as a
window with a lime-green background containing several prefabricated drawing
components, known as “masters.” Each stencil exists as a separate file with the
extension .VSS. If you installed Visio in its default location, the stencil
files are located in C:\Program Files\Visio\Solutions. Each subfolder in the
Solutions folder contains a category of stencils, which you will see when you
select File | Stencils, as shown in Figure A.
| Figure A |
 |
Creating
your ownNone of the Network Diagram stencils contained a master that
was suitable for a 12-port module on a Cisco Catalyst 6509, so I drew my own
using the basic drawing tools built into Visio, as shown in
Figure B.
| Figure B |
 |
After completing the drawing,
I wanted to turn it into a master. If you will notice back in Figure A, one of
the choices when you click File | Stencils is New Stencil. When you choose this
command, a blank stencil appears to the left of your screen with the default
name Stencil
x, where
x is the sequential number of the stencils
you create. To make my drawing a master in that new stencil, all I had to do was
marquee-select the entire drawing (click to the left and above the drawing, drag
to below and to the right of the drawing, and release) and then drag it into the
blank stencil area and drop it there. The drawing immediately became a master,
with an icon resembling its basic shape and the default name of
Master.0.
Saving and modifying the
stencil
At this point, the stencil is in edit mode. (You can tell by
the red asterisk that appears in the stencil icon next to the stencil name.)
You can’t take the stencil out of edit mode until you save it. To do that,
right-click on the stencil title bar, as shown in Figure C, and select
Save As.
Since this will be a separate file, you can save it anywhere. However,
it will be most useful within Visio if you save it in the Program
Files\Visio\Solutions\Network Diagrams folder. Once you have done that, you can
toggle the stencil between edit mode and read-only mode.
| Figure C |
 |
Even after you save a stencil
with a specific name, that name won't appear in the stencil's title bar. The
name that appears in the title bar is a feature of the stencil's properties. To
change its properties, right-click on the title bar and select Properties to
open a dialog box similar to the one shown in Figure D.
| Figure D |
 |
As you can see, I changed the
title that appears in the title bar to Switch Ports and added a category and a
description. You'll also notice that I specified several keywords. This is
helpful because Visio includes a feature called Shape Explorer, which allows you
to search for masters based on keywords. To use Shape Explorer, click on Tools |
Macros | Shape Explorer.
Modifying the
master
The last step in this process is to modify the properties of
the master itself. When you right-click on the master within the stencil, you'll
see the menu shown in Figure E.
| Figure E |
 |
In addition to setting
properties for the master, this menu will allow you to edit the master or even
edit the icon that represents the master. In my case, all I needed to do was
change the name of the master from Master.0 to something more useful. Since I
wanted to create four of these, representing ports 1-48, I changed the name to
Module 1, as shown in Figure F.
| Figure F |
 |
Summary
Microsoft Visio is not a restrictive
“take-it-or-leave-it” program. By enabling you to create your own stencils and
masters, it lets you do exactly what you want it to do. And since the stencils
are created as separate files, you can share the stencils and masters within
your office or e-mail them to fellow admins so that they can use them in their
own Visio diagrams.