Microsoft KB Archive/254713

From BetaArchive Wiki

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.

MORE INFORMATION

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:

  1. On another part of your drawing page, create a rectangle smaller than the first.
  2. 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.
  3. 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:
  4. 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.
  5. 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

  1. Place the new multishape inside of the larger rectangle created when you began this exercise. Your drawing should look like this:
  2. Select the larger rectangle, hold down the SHIFT key, and then select the multishape.
  3. On the Shape menu, point to Grouping, and then click Group to group the selections.
  4. 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.
  5. While the shape is still selected, click Show ShapeSheet on the Window menu.
  6. On the Insert menu, click Section.
  7. In the Insert Section dialog box, click to select the Actions, User-Defined Cells, and Custom Properties check boxes, and then click OK.
  8. Locate the Actions section in the ShapeSheet window, and then enter the following in the appropriate cells:
    Actions Action Menu Prompt
    1 DOCMD(1312) "Change Shape" "Change the way the shape looks"



  9. Locate the User-Defined Cells section, and change the leftmost cell name from User.Row_1 to ShapeType; it should then read User.ShapeType.
  10. Locate the Custom Properties section and change the leftmost cell name from Prop.Row_1 to ShapeType; it should then read Prop.ShapeType.
  11. 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.
  12. Return to the Custom Properties section and enter the following information in the appropriate cells:
    Custom Properties Label Prompt Sort Key Type Format Value Invisible Ask
    Prop.ShapeType "Shape Type" "Shape Type" 0 1 "Rectangle;Oval;Line" "Oval" 0 "EventDrop"



  13. Close the ShapeSheet window for the shape.
  14. Select the shape if it is not selected already, and then click Open Group on the Edit menu.
  15. When the group editing window opens, select the multishape that you created earlier.
  16. 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.
  17. 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.


Keywords: kbGraphxLink kbgraphxlinkcritical KB254713
Technology: kbVisio2000Search kbVisio500xSearch kbVisioSearch kbZNotKeyword3