3 4
You can edit the properties for any individual shape, or you can take advantage of a great new feature in Visio 2002 called a custom property set. This feature provides a quick way to define and work with a group of custom properties, and then apply them wholesale to a group of shapes. To create a custom property set, you define a name for the set and then add the properties you want to include. Then you can apply your property set to selected shapes on the drawing page, the document stencil, or any open stencil. When you create custom properties in this way, it's easy to edit labels and formats for the entire set.
Custom property sets become especially useful when you import objects to use as shapes or draw shapes from scratch. The imported and from-scratch shapes won't have the same custom properties as other shapes in the drawing. For example, in a floor plan, shapes can be used to track facilities and equipment information through their custom properties. If you convert a CAD symbol library to Visio shapes, the converted shapes don't have custom properties. However, you can quickly add the entire set of facilities and equipment properties to the converted shapes.
You can apply only one custom property set to a shape or master shape. When you apply a custom property set to a shape that already has a set, Visio applies the new property set and removes the previous one. If you apply a custom property set to a shape that has custom properties, but not a custom property set, the original properties are retained and the new set of properties are added.
InsideOut
To define a custom property set or edit its definition, you use the Edit Custom Property Set add-on, which lets you do the following:
The definition of a custom property set includes the names of the set as well as names (labels) for each custom property in the set and its data type, format, value, and prompt, as Figure 6-12 shows. A custom property set is saved with a document. If you open a stencil file and create a custom property set, the set is saved with the stencil, and you can then apply it to master shapes on the stencil. If you define a custom property set in a drawing, you can apply the set to shapes on the drawing page or master shapes on the drawing's document stencil.
You can also change the definition of an existing custom property set to rename or delete a set, or work with individual custom properties in a set. For example, you can edit property labels so that the labels you want appear in the Custom Properties window, or add and remove individual custom properties that are included in a set.
Tip
Figure 6-12. With the Edit Custom Property Set add-on, you can create a new custom property set and define its properties as well as add and remove individual custom properties.
An easy way to create a custom property set is to copy the custom properties defined for an existing shape, and then create a set from those properties. You can also copy the custom properties that are included in an existing set to create a new custom property set and revise its definition as you want. When you copy custom properties, you avoid starting from scratch and can take advantage of existing definitions. For example, if you're working with Visio shapes that include a custom property set, you can create a new set based on the existing one and then revise the property labels so that the names you want appear in the Custom Properties window. That way, you don't alter the original shapes or their definitions, but you can customize at will.
To create a new custom property set based on a shape with properties, follow these steps:
In the Add Custom Property Set dialog box, the option Create A New Set From The Shape Selected In Visio is selected.
In the Edit Custom Property Sets box, the new set is listed and selected. Its properties, taken from the selected shape, are listed under Custom Properties at the bottom of the dialog box.
A new custom property set is created and stored with the document. To apply the set to other shapes, see the sections that follow.
To create a new custom property set based on the definition of an existing set, follow these steps:
Visio adds the new custom property set and its property definitions to the active document.
You can create a custom property set from scratch and define each custom property that you want to include in the set. If you're working with stencils and documents that do not contain custom properties, such as a new stencil that you've created, this is the best way to add custom properties. You create a set, define each property in the set, and then apply the set to your shapes as described later in this chapter.
To create a new custom property set and define its properties, follow these steps:
You can open either a drawing or stencil file. If you plan to apply the set to master shapes, open the stencil for editing (right-click its title bar, and then click Edit).
The new set is listed in the Edit Custom Property Sets dialog box. In the Custom Properties box, no properties are listed.
The Define Custom Properties dialog box appears and lists Property1 as the default, initial custom property.
For details about these options, see Table 6-2. If you're not certain which Type option to select, select String.
A new custom property set is created and stored with the document. To apply the set to other shapes, see the sections that follow.
You can edit the definition of a custom property set. Specifically, you can change the name of the set itself and you can edit the custom properties in the set. When you use the Edit Custom Property Set add-on to revise an existing set, the changes are saved in the active document, which can be a drawing or stencil file. The main thing to remember when you edit a set is that you'll have to update any shapes that use that custom property set—Visio does not update the shapes to which a custom property set is applied.
To edit a custom property set, follow these steps:
The Define Custom Properties dialog box appears and lists the definition for the first custom property, which is selected in the Properties list at the bottom of the dialog box.
Note
Visio adds the properties to the shape, which you can see in the Custom Properties window.
With the Apply Custom Property Sets add-on, you can assign a custom property set to specified shapes in a drawing. It's probably more often the case that you'd apply custom property sets to master shapes, but sometimes you just need to update shapes on the drawing page. For example, if you use the drawing tools to create new shapes in a diagram, you can apply the custom property set used by other shapes to the new shapes. The Apply Custom Property Set add-on lists all the custom property sets defined for the active document—that is, your drawing file. You select the set you want, run the add-on, and choose the custom property set you want, and then Visio adds the set of properties to the selected shape.
Before you can use the Apply Custom Property Set add-on, you need to make sure that your document contains custom property sets. If the active document does not include a set, you'll see <None> listed in the add-on when you run it. Some Visio shapes include custom properties that were defined the old-fashioned way—without the set feature that became available only in this version of Visio. You can use the Edit Custom Property Sets add-on to define a new custom property set and then apply it using the procedure that follows.
Caution
To add a custom property set to selected shapes, follow these steps:
If this option is dimmed, no shapes are selected on the page. Click Cancel, select a shape, and then repeat this procedure.
After editing property names in a set, the changes do not appear in the Custom Properties window for selected shapes.
When you use the Edit Custom Property Set command, you can make changes to an existing set of properties, but Visio does not apply those changes to existing shapes, even if they are assigned to the set you edited. You must use the Apply Custom Property Set command to update the shapes with the edited set.
If you've created your own shapes, or want to revise Visio master shapes to use a particular set of custom properties, you can apply a custom property set to all or selected master shapes on a stencil. You can run the Apply Custom Property Sets add-on to add sets of properties to the master shapes you select in an open stencil file. The stencil file can be any of the following:
Caution
To add a custom property set to selected master shapes, follow these steps.
In the Apply Custom Property Set dialog box, the option Apply To Shapes In A Stencil is selected, and the option Apply To Shapes Selected In Drawing is dimmed.
Note
Visio applies the custom property set to the selected master shapes. Depending on the number of shapes you select, you might see a progress indicator as Visio applies the set to all the shapes. The next time you drag a master shape from the stencil, the shape on the page will include the set of custom properties.
You can delete individual custom properties from shapes and master shapes. You can also delete custom property sets, although all you delete is the definition for the set. If you apply a custom property set to shapes, and then delete the set, the shapes retain their custom properties. However, the document no longer knows that the properties came from a set.
To delete a custom property set, follow these steps:
Visio removes the custom property set from the active document. Shapes that include custom properties from the deleted set are not changed—they retain their custom properties.
It's wise not to delete built-in custom properties that come with many of the Visio shapes. These properties may be required by the solution to accommodate the shape's "smart" behavior. For example, organization chart shapes include a number of invisible custom properties that don't appear in the Custom Properties window, but may appear in the Define Custom Properties dialog box, which means that you can delete them. However, the organization chart engine uses these properties to track document and layout options, so you do not want to delete them.
To delete an individual custom property from a shape or master shape, follow these steps:
Tip
Visio deletes the custom property from the selected shape. You don't get a warning first, but you can undo the operation after you've closed the dialog boxes.
Note
Visio displays a message asking whether you want to update the master.
If you edited a document stencil, all the shapes in the drawing that are based on the master shape you edited will no longer include the deleted custom property.