Microsoft KB Archive/254713

= Visio: How to Create a Multishape =

PSS ID Number: 254713

Article Last Modified on 6/4/2003

-

The information in this article applies to:


 * Microsoft Visio 2000 Standard Edition
 * Microsoft Visio 2000 Professional Edition
 * Microsoft Visio 2000 Technical Edition
 * Microsoft Visio 2000 Enterprise Edition
 * Microsoft Visio Standard 5.0x
 * Microsoft Visio Professional 5.0x
 * Microsoft Visio Technical 5.0x
 * Microsoft Visio Enterprise 5.0x

-



This article was previously published under Q254713



SUMMARY
Several shapes in Visio have built-in intelligence that enables you to switch between several versions of the shape using the shortcut menu. Such intelligent shapes are called "multishapes."

This article shows you how to create your own multishape. The article guides you through the process of building a shape that features a shortcut menu command for changing certain shape properties. After working through the steps in this article, you will be able to design your own multishapes.

NOTE: This document assumes you are familiar with the ShapeSheet window, including changing values and formulas in individual cells.



Background Information
To see an example of a Visio multishape, open the Flowchart Template and, from the Basic Flowchart Shapes stencil, drag the "Flowchart Shapes" shape onto the drawing page. Right-click the shape and click any of the four options on the shortcut menu and watch how the shape changes. Your multishape will behave the same way.

How to
Before you get started, create a new blank drawing not based on a template. Then, use the Rectangle tool to create a rectangle. Be sure to make the rectangle large enough to place another rectangle inside of it later.

To make the multishape part of your master shape:  On another part of your drawing page, create a rectangle smaller than the first. Use the Oval tool to draw a circle within the smaller rectangle.

NOTE: Hold down the SHIFT key while drawing with the Oval tool to create a circle. Use the Line tool to draw a line bisecting the circle, making it the same height as the rectangle. When you are finished, the shapes should look like this:



 While using the Pointer tool, hold down the left mouse button and then drag the selection net around the stacked shapes. You should now be able to see three sets of selection handles. On the Shape menu, point to Operations, and then click Combine. This combines the three shapes to create a single shape with multiple geometry sections.

TIP: To view the multiple geometry sections, click Show ShapeSheet on the Window menu.

To Make the Master Shape
 Place the new multishape inside of the larger rectangle created when you began this exercise. Your drawing should look like this:



</li> Select the larger rectangle, hold down the SHIFT key, and then select the multishape.</li> On the Shape menu, point to Grouping, and then click Group to group the selections.</li> While the new grouped shape is still selected, click Special on the Format menu. Write down the name of the shape; you will need this later. The shape will probably be named something like Sheet.2.</li> While the shape is still selected, click Show ShapeSheet on the Window menu.</li> On the Insert menu, click Section.</li> In the Insert Section dialog box, click to select the Actions, User-Defined Cells, and Custom Properties check boxes, and then click OK.</li> Locate the Actions section in the ShapeSheet window, and then enter the following in the appropriate cells:

</li> Locate the User-Defined Cells section, and change the leftmost cell name from User.Row_1 to ShapeType; it should then read User.ShapeType.</li> Locate the Custom Properties section and change the leftmost cell name from Prop.Row_1 to ShapeType; it should then read Prop.ShapeType.</li> Return to the User-Defined Cells section and enter the following in the Value cell: LOOKUP(Prop.ShapeType,Prop.ShapeType.Format)

NOTE: You must complete step 10 before entering this formula or you will get an error. This formula references the Prop.ShapeType cell in the Custom Properties section.</li> Return to the Custom Properties section and enter the following information in the appropriate cells:

</li> Close the ShapeSheet window for the shape.</li> Select the shape if it is not selected already, and then click Open Group on the Edit menu.</li> When the group editing window opens, select the multishape that you created earlier.</li> On the Window menu, click Show ShapeSheet. The ShapeSheet window for this shape will have three geometry sections: one for the line, one for the oval, and one for the rectangle.</li> <li>Replace all occurrences of Sheet.Name with the name that your wrote down in step 4, as follows:

In the B cell of Geometry 1 type =NOT(Sheet.Name!User.ShapeType=2)

In the B cell of Geometry 2 type =NOT(Sheet.Name!User.ShapeType=1)

In the B cell of Geometry 3 type =NOT(Sheet.Name!User.ShapeType=0)

If your shape does not change its shape properly when you select its type in the Custom Properties dialog box, you may need to switch the "User.ShapeType=x" lines around until you find the correct combination. The B cell of the Geometry section tells the shape to show or hide itself. The B cell formulas shown above reference User-Defined cell name ShapeType of the parent shapes, which will have a value of 0 (zero), 1, or 2.</li></ol>

Keywords: kbGraphxLink kbgraphxlinkcritical KB254713

Technology: kbVisio2000Search kbVisio500xSearch kbVisioSearch kbZNotKeyword3

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.