Identifying Shape Behavior

3 4

Just as vertices and line segments constitute basic shape geometry, lines and boxes represent the basic differences in shape behavior. Behavior means the way you interact with shapes on the page—that is, moving, sizing, and connecting them. When a shape behaves like a line, it can be stretched and rotated in one step by dragging an endpoint. For example, the Wall shape on the Office Layout Shapes stencil behaves like a line. 1-D shapes have this behavior. When a shape behaves like a box, it can have up to eight selection handles, including corner handles that you can use to resize the shape. 2-D shapes have this behavior.

Chapter 2 introduced the difference between 1-D and 2-D shapes. How much more do you need to know about 1-D and 2-D shapes? If you want to design your own shapes, you'll need to understand shape behavior, a fundamental Visio concept that helps you answer important questions: what kind of sizing behavior do you want your shape to have? Do you want your shape to connect to other shapes? If you create and revise shapes only as needed for different diagrams, it's still useful information, because 1-D and 2-D shapes look different when you select them and act quite differently when you use them.

Understanding 1-D Shape Behavior

A 1-D shape behaves like a line, but note that it doesn't necessarily have to look like a line, as Figure 22-4 shows. To identify a 1-D shape, select it, and then choose Shape, Behavior. If Line (1-Dimensional) is selected under Interaction Style, it's a 1-D shape.

figure 22-4. you can tell these are 1-d shapes, because each has a begin point and endpoin.

Figure 22-4.  You can tell these are 1-D shapes, because each has a begin point and endpoint.

Technically, any shape that has a begin point (the end with an ×) and an endpoint (the end with a +), either of which can be glued to other shapes, is 1-D. Together, these two points form part of the built-in intelligence of 1-D shapes. If other shapes are connected to the line, the begin and endpoints can imply directionality. The begin and endpoints also determine where the arrows and other line end styles go when you apply them with the Format, Line command, as Figure 22-5 shows. Only 1-D shapes can have line ends.

figure 22-5. visio applies the line end patterns to the begin point and endpoint when you select an option in the begin and end lists.

Figure 22-5.  Visio applies the line end patterns to the begin point and endpoint when you select an option in the Begin and End lists.

InsideOut


During the design phase for the first version of Visio, the developers decided that Visio should provide feedback to users. Vertices, control points, selection handles, begin and endpoints—all those green, yellow, and red points you see when a shape is selected—are examples of visual feedback. They're meant only to help you more easily edit and work with shapes. Some users find the feedback visually distracting, but Visio provides for this possibility. You can turn off the display of some types of visual feedback by selecting an option on the View menu.

Understanding 2-D Shape Behavior

A shape that has selection handles for changing width and height is a 2-D shape, as Figure 22-6 shows. To identify a 2-D shape, select it, and then choose Shape, Behavior. If Box (2-Dimensional) is selected under Interaction Style, it's a 2-D shape.

figure 22-6. you can tell these are 2-d shapes because of the corner selection handles.

Figure 22-6.  You can tell these are 2-D shapes because of the corner selection handles.

Visio includes two special types of 2-D shapes that can have confusing behavior:

  • Merged shape. The term merged shape refers to any shape created as a result of using a shape operation command, such as Combine or Join. These shapes are noteworthy, because they typically have complex geometry and resemble groups. However, they are 2-D shapes with unique formatting behavior.

    For details about merged shapes, see "Merging Shapes to Create New Ones."

  • Group. A group is an object in its own right made up of other shapes. Each shape in the group can have independent attributes, as can the group.

    For details about groups, see "Working with Groups."


Identifying Other Visio Objects

Shapes aren't the only objects in Visio with properties and behavior. Groups, imported graphics, guide lines, connection points, and even the drawing page are all objects in Visio. Like shapes, these other objects are represented in the ShapeSheet window. That means you can control them programmatically—a useful exercise when you want to automate diagrams.


Converting 2-D Shapes to 1-D

You can convert a 2-D shape to a 1-D shape when you want a shape to behave like a line. In fact, the easiest way to create a 1-D shape is often to draw a 2-D shape, and then convert it. The important thing to remember is to draw from left to right so that after you convert the shape to 1-D, its begin and endpoints behave correctly. For example, if you draw the outline of an arrow using lines, you'll create a 2-D shape. If you want the arrow to connect to other shapes or align more easily, you can convert it to 1-D, as Figure 22-7 shows. When you convert a shape to 1-D, its handles change to begin and endpoints, and the alignment box is updated.

figure 22-7. you can use the behavior command to convert a 2-d arrow to a 1-d arrow that can be glued to other shapes.

Figure 22-7.  You can use the Behavior command to convert a 2-D arrow to a 1-D arrow that can be glued to other shapes.

Follow these steps to convert a 2-D shape to 1-D:

  1. Select the shape, and then choose Format, Behavior.

  2. Under Interaction Style, select Line (1-Dimensional), and then click OK.

Tip - Reverse the Begin and Endpoints


After you convert a shape, make sure its begin point (×) is on the left or top and its endpoint (+) is on the right or bottom. If they're backward, you can switch them easily. Select the shape, and then choose Shape, Operations, Reverse Ends.

Converting a shape dramatically alters its ShapeSheet, which you need to know if you want to create SmartShapes formulas. After you convert a 2-D shape to 1-D, the Alignment section is deleted, the 1-D Endpoints section is added, and new 1-D formulas are added to the Width, Angle, PinX, and PinY cells of the Shape Transform section.

Understanding Closed and Open Shapes

Shapes must be closed for fill patterns and colors to be applied. Closed means that the shape's line segments form a continuous path. The less precise way to think of this is that the line is sealed all the way around, so fill won't leak out. However, this analogy ultimately fails, as you'll see. Sometimes an entire shape is a closed path, such as a rectangle. Sometimes a shape contains multiple closed paths, such as a rectangle with polka dots. If you select the plain rectangle and click a fill color (let's say yellow), the entire rectangle turns yellow. If you select the polka-dotted rectangle, and then click the yellow fill, what happens? You might expect the dots to turn yellow, but perhaps you really want the rectangle around the dots to turn yellow, as Figure 22-8 shows. Either behavior can happen depending on how the shape was designed, which is why you need to consider the closed paths in shapes that you create.

figure 22-8. in merged shape a (the swiss cheese), the dots are open paths, and in merged shape b, the rectangle is an open path. in group c, the dots are a group, and they're grouped with the rectangle so that both the dots and the rectangle can be filled separately.

Figure 22-8.  In merged shape A (the Swiss cheese), the dots are open paths, and in merged shape B, the rectangle is an open path. In group C, the dots are a group, and they're grouped with the rectangle so that both the dots and the rectangle can be filled separately.

If the line segments in a shape are not continuous, the shape is open, which explains why you cannot fill certain shapes. For example, if you draw an arc, it's an open path, and you can't apply a fill color to it under normal circumstances. (However, you can edit the shape's geometry to accept fill. It's weird but true. For details, see the sidebar "How to Fill Open Shapes.")

Drawing Closed Shapes

When you're drawing 2-D shapes with the Pencil, Line, Arc, or Freeform tool, you must close the path if you want the shape to have a fill color or pattern. In practice, closing a path is tricky. If the last segment you draw doesn't overlap the first, the shape is open and can't be filled. You can use the Pencil tool to close an open shape or path in an existing shape.


How to Fill Open Shapes

You can fill just about any shape you want, including arcs, lines, and squiggles that don't look like their paths are closed. In the ShapeSheet window, you can define a shape to be closed even if it looks wide open.

Try it yourself: use the Pencil or Arc tool to draw a bowl-like curve. Select the curve, and then choose Window, Show ShapeSheet. Scroll down to the Geometry 1 section. (Click the heading to expand it if necessary.) In the cell labeled Geometry1.NoFill, the value is set to TRUE, meaning that it's true that you cannot fill this shape. Select the cell (not its label), type FALSE, and then press Enter. Now you can fill the shape. Close the ShapeSheet window, and then apply a fill color and see what happens.

Although it's possible to fill such shapes, does it make sense to do so? It's useful to know about the NoFill cell when you're working with shapes that have multiple closed paths, such as the rectangle with polka dots shown earlier. Such shapes can result from using a shape operation such as Combine to create a merged shape. Should the dots or the rectangle receive fill color? Maybe you want the entire shape, dots and all, to be filled. If so, you would want to know how to make the closed paths open. (Set their NoFill cell to TRUE.)


Tip


When you draw a closed shape, Visio fills it with white fill color by default. If you can see the grid through your shape, you know it's not closed.

Follow these steps to close a shape:

  1. Click the Pencil tool, and then select the shape to display its vertices.
  2. To close a path, select a vertex, and then drag the vertex over the vertex of the first segment.

  3. To draw a line that closes the open path, draw a line from the last vertex to the first.


Troubleshooting

When closing a line segment, the line stretches instead.

When you're dragging a vertex with the Pencil tool, it's easy to stretch the line accidentally instead of close the path. The ending vertex must align exactly with the starting vertex to close a path. If the vertices don't line up exactly, Visio creates a new line segment instead, and the shape isn't closed. It's sometimes easier to repair the problem if the shape is not selected. Then click the Pencil tool and draw a line segment from one vertex to another. To make the task smoother, try the following:

  • Turn snapping on. Choose Tools, Snap & Glue. On the General tab, select the Snap check box. Under Snap To, make sure Grid is selected.
  • Align the shape's vertices to the grid. Use the arrow keys to nudge the shape into alignment with the grid.
  • Zoom in close. Press Shift+Ctrl+click with the mouse to zoom in.



Microsoft Visio Version 2002 Inside Out
Microsoft Visio Version 2002 Inside Out (Inside Out (Microsoft))
ISBN: 0735612854
EAN: 2147483647
Year: 2000
Pages: 211
Authors: Nanette Eaton

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net