Microsoft Office Visio 2003 Inside Out (Inside Out (Microsoft))

If you want to use a fill pattern, line pattern, or line end not available in Visio, you can create your own. Custom patterns are powerful and peculiar. They work roughly like this: you create a shape and tell Visio to use it as a fill pattern, line pattern, or line end. You specify the attributes you want, and then Visio adds your pattern as an option in the Fill or Line dialog box. You can then apply the pattern to a shape in the usual way.

Understanding Pattern Philosophy

The pattern you design is a simple shape or group, as Figure 23-11 shows. The options you set for your pattern determine the way it looks when applied to a shape. The results can be dramatically different, as Figure 23-12 shows.

Figure 23-11: To create a custom pattern you design the single element that will be repeated when the pattern is applied; in this case it is a simple x shape.

Figure 23-12: You can design a variety of fill patterns, line patterns, and line ends, and then apply them to shapes. The same simple pattern—the x shape—looks very different when applied as a fill pattern (A), line pattern (B), or line end (C).

The actual process for creating reliable patterns is somewhat complicated. That is, it’s easy enough to draw a shape and define it to be a pattern, but it’s an entirely different matter to get the results you want when the pattern is applied. That’s where the “powerful and peculiar” come in. There are a lot of tricks to designing a shape that can be applied as a pattern, and Visio gives you many options to consider as well: Will the pattern ever be applied to shapes in a scaled diagram? Do you want the pattern to be tiled across a shape or stretched to fill it? What should happen to the pattern when a shape is stretched or a line is bent? The answers to these questions are the pattern’s behavior, which you define when you create the pattern.

Methods of Creating a Pattern

The only way to create a pattern is through the Drawing Explorer window. To open it, choose View, Drawing Explorer Window. The Fill Patterns, Line Patterns, and Line Ends folders store new patterns that you create or other custom patterns that come with certain diagram types, as Figure 23-13 shows.

Figure 23-13: To create a new pattern, right-click a pattern folder, and then click New Pattern.

After you’ve created a pattern, you can apply it to other shapes as you would any of the built- in fill and line patterns. Depending on the type of pattern you design, your pattern appears as an option in the Fill or Line dialog box, as Figure 23-14 shows.

Figure 23-14: Patterns you create appear at the bottom of the list of available patterns. Here, custom-designed line patterns are shown.

You can create a master pattern from a shape you create in Visio or a shape that already exists and set its properties, which affect how the pattern behaves. For example, you can choose how the pattern will appear when it’s applied to a shape, how it responds when the shape is resized, or how it responds when the drawing page scale changes. You draw the pattern shape in a drawing window that Visio opens when you choose the Edit Pattern command by right- clicking a pattern in the Drawing Explorer window. The pattern’s drawing page looks just like the regular drawing page or the drawing page for a master shape. When you work in the pattern’s drawing page, the menus and toolbars display all the commands and tools you can use in designing your pattern. Table 23-1 lists the fundamental techniques to use and avoid when creating your own patterns.

Table 23-1: Dos and Don’ts for Creating Patterns

Do

Don’t

Create a pattern as a single instance of the design that repeats. For example, you can design one square as a pattern that repeats to form a checkerboard.

Use multiple shapes in a pattern unless you group (Ctrl+G) or combine (choose Shape, Operations) them.

Use Visio’s drawing tools.

Use Visio patterns in your pattern. For example, your pattern design cannot use a gradient (graduated color) fill.

Copy an existing shape.

Use a bitmap image or metafile in your pattern—they won’t show up when the pattern is applied.

Design a pattern in black and white. Then, when you apply the pattern, you can click a new line or fill color to change the pattern color.

Use color in your pattern design unless you want the pattern to keep its color. For example, a green pattern stays green.

Designing a Pattern Shape

When you design a shape to use as a pattern, shape geometry is a big factor in how the pattern will be applied. You can choose different pattern behaviors that specify how the pattern is repeated on a shape, but when you design the pattern itself, you want to use a shape or shapes that will be positioned in a predictable way. Visio uses your pattern shape’s pin and alignment box to determine where to put the pattern. A shape’s pin is its center of rotation, a point that you can move. A shape’s alignment box is its bounding edges, which don’t have to match the shape’s width and height.

Adjusting the Pin

Should the pattern’s pin be in the center, on an edge, or in the corner? When you create a new shape, Visio automatically places the pin in the center, and uses it as the center of rotation. In a pattern, Visio uses the pin to align the pattern shape to the shape it’s being applied to. If you move the pin, you can affect the position of the pattern as it is tiled along a line or repeated as fill, as Figure 23-15 shows. The easiest way to adjust pin position is to display the Size & Position window (choose View, Size & Position Window), and then use the Pin Pos option.

Figure 23-15: Visio repeats a line pattern based on its pin position.

Adjusting the Alignment Box

Should the pattern’s alignment box tightly enclose the shape? Typically, a shape’s alignment box is the same as its outer edges. In a pattern, Visio uses the alignment box to determine whether the pattern overlaps as it is tiled along a line. You can make the alignment box smaller or larger than the shape it encompasses. A small alignment box can produce a fishscale effect. A large alignment box (shown in Figure 23-16) leaves spaces between repeating pattern elements.

Figure 23-16: The alignment box for this pattern shape is slightly larger than the shape itself. When applied, the pattern will leave space around the repeating shape.

Changing the size of a shape’s alignment box requires some fancy footwork. The easiest way is as follows:

  1. Use the Rectangle tool to draw a shape in the size and position you want the alignment box to be.

  2. Select the rectangle and your pattern shape, and then group them (press Shift+Ctrl+G).

  3. Select the new group, and then choose Edit, Open Group to display the group window.

  4. In the group window, delete the rectangle. Close the group window.

Now all that remains is your pattern shape, surrounded by the alignment box that was set by the size of the group.

Inside OutSeeing and editing patterns

Here’s a technique borrowed from Visio shape developers that you can use to make it easier to see and edit patterns. After you’ve designed a pattern, on the pattern’s drawing page, choose File, Page Setup. On the Page Size tab, select Size To Fit Drawing’s Content, and then click OK. Visio reduces the page to the size of your pattern design, which makes it easier to see the pattern’s alignment box and edit it later if necessary.

Designing and Creating a Fill Pattern

A fill pattern is applied to the interior of a closed shape. Visio can tile, stretch, or center a pattern to fit the shape, but the most common pattern behavior is to tile, or repeat, a pattern. That’s how a single dot becomes polka dots and a single square becomes a checkerboard pattern. Figure 23-17 shows the three basic fill pattern behaviors.

Figure 23-17: You can design a fill pattern that tiles when applied to a shape (A), is centered in a shape (B), or stretches to fill a shape (C).

How Fill Patterns Are Applied

Visio applies your pattern design differently depending on the behavior you select:

Designing a Fill Pattern for Scaled Drawings

When you’re designing a pattern for use in a scaled drawing such as a floor plan, you’ll get better results if you set the pattern’s drawing page to the same drawing scale. If the scales don’t match, Visio will try to apply the pattern anyway. A tiled pattern can end up looking like solid black. If the scale of the pattern is more than eight times larger or smaller than the scale of the shape you’re applying it to, Visio ignores the pattern’s scale altogether. Unscaled patterns stay the size that you designed them to be. For example, if you create an unscaled pattern that’s 1/4 inch in height, when you apply it to a shape in either a scaled or unscaled drawing page, the pattern design will still be 1/4 inch in height. Issues of scale and pattern size don’t apply when you design a pattern with stretching behavior.

Designing Solid vs. Transparent Fills

When Visio repeats your pattern in a shape, the space between the repeating elements is transparent unless you design the pattern to use a solid color. For example, if your pattern looks like a black circle, and you apply it as a tiled pattern to a square, the square will be filled with solid-color polka dots with transparent areas between the dots. Anything behind the square shows through. You have replaced the shape’s solid (white) fill with a new fill (polka dots). The solid fill is gone, so there is nothing to hide the background. Or you can think about those polka dots like this: you are tiling your shape with imaginary squares. Each square is the alignment box of a circle; it contains the circle, and nothing else. If you want dots with a white background, put a white square underneath your dot (with line pattern = None). If you want the white to stay white, make it RGB(254, 254, 254) instead of color index 1.

Creating Fill Patterns

To create a fill pattern, follow these steps:

  1. If the Drawing Explorer window isn’t open, choose View, Drawing Explorer Window.

  2. In the Drawing Explorer window, right-click Fill Patterns, and choose New Pattern.

  3. In the Name box, type a name for the pattern as you want it to appear in the Pattern box for fills.

  4. In the Behavior area, select one of the following:

    • Select tiled behavior, and the pattern will repeat to fill a shape.

    • Select centered behavior, and the pattern will be centered on a shape.

    • Select stretching behavior, and the pattern will stretch to fit a shape.

  5. If the pattern will be used in diagrams with a drawing scale, select the Scaled check box.

  6. Click OK to add the new pattern to the Fill Patterns folder in the Drawing Explorer window.

  7. Right-click the new pattern in the Drawing Explorer window, and then select Edit Pattern to open a new drawing page, where you can create the pattern design.

  8. Draw a new pattern, or copy a shape from the main drawing page and paste it on the pattern’s drawing page. If your pattern includes more than one element, group them (Shift+Ctrl+G), or use a shape operation to combine them (Shape, Operations).

  9. If you want a scaled pattern, choose File, Page Setup, and then on the Drawing Scale tab, set the pattern’s drawing scale. Click OK.

  10. When you’re finished with your pattern design, click the Close button on the pattern’s drawing page window. Visio displays a message similar to the following.

  11. Click Yes to update the pattern design.

    Tip

    You can apply the new fill pattern as you would any fill: select a shape, and then choose Format, Fill. In the Pattern box, the new pattern is listed below the built-in patterns.

Creating a Line Pattern

When you design a shape to use as a line pattern, you need to consider the way that Visio will apply the pattern to both straight and curving lines of varying degrees of thickness. Visio applies a line pattern in one of the following ways:

How Line Patterns Are Applied

Visio uses the pin of your pattern shape (that is, its center of rotation) to align the pattern to a line. Figure 23-18 shows examples of each type of pattern behavior.

Figure 23-18: The single, repeating element in each of these line patterns is an x shape. In pattern A the x is tiled and bent to follow the line. In pattern B the x is tiled but not bent. In pattern C the x is stretched along the line, and in pattern D the x is tiled at intervals like beads on a string.

Designing Line Patterns for Scaled Drawings

Each of the four line pattern behaviors has an additional option: scaled or unscaled. When you design a scaled line pattern, Visio resizes the pattern when it’s applied—the height of the pattern shape’s alignment box is set to match the line weight.

Note

When you apply a line pattern, Visio can display up to 1000 instances of your pattern design along a line.

Creating Line Patterns

To create a line pattern, follow these steps:

  1. If the Drawing Explorer window isn’t open, choose View, Drawing Explorer Window.

  2. In the Drawing Explorer window, right-click Line Patterns, and then select New Pattern.

  3. In the Name box, type a name for the pattern as you want it to appear in the Pattern list.

  4. In the Behavior area, select one of the following:

    • Select bending behavior, and the pattern bends as it is repeated around curves.

    • Select brick-style behavior, and the pattern repeats without bending along a line.

    • Select stretching behavior, and the pattern stretches along a line. Visio doesn’t repeat the pattern design.

    • Select beads-on-a-string behavior, and the pattern resembles strung beads.

  5. If the pattern will be used in diagrams with a drawing scale, select the Scaled check box.

  6. Click OK to add the new pattern to the Line Patterns folder in the Drawing Explorer window.

  7. Right-click the new pattern in the Drawing Explorer window, and then choose Edit Pattern to open a new drawing page, where you can create the pattern design.

  8. Draw a new pattern, or copy a shape from the main drawing page and paste it on the pattern’s drawing page. If your pattern includes more than one element, group them (Shift+Ctrl+G), or use a shape operation to combine them (Shape, Operations).

  9. When you’re finished with your pattern design, click the Close button on the pattern’s drawing page window. Visio displays a message asking whether you want to update the pattern and all of the shapes that might be using it as a pattern. Click Yes to update the pattern design.

    Tip

    If you apply a line pattern or line end pattern and it doesn’t look the way you expected it to (for example, it’s too small to see), try increasing the line weight.

Creating a Line End Pattern

Most people think of line ends as arrowheads, but many technical drawing types use unique line ends to convey meaning. For example, line ends in software and database models define relationships between objects, whereas in piping diagrams, they show the direction of flow. Line ends are easier to design than fills or line patterns, because they’re really just shapes stuck on the ends of a line. The behavior options you have boil down to the direction in which your line ends will point. Visio provides two options, as Figure 23-19 shows:

How Line End Patterns Are Applied

Visio aligns the pin of your line end shape to the endpoint of a line. If you move the pin to the edge of the line end that you want to attach to the line, and then specify the in-line behavior, you can get the same effect as the built-in, solid arrowhead line ends in Visio. In addition, how you draw the line end pattern affects its application. Do the following to ensure your line ends behave as you want them to:

Designing Line End Patterns for Scaled Drawings

Whether the line ends are in-line or upright, they can be scaled or unscaled, which affects their size when applied to a line, as Figure 23-20 shows. If your pattern represents a real- world object in a scaled drawing, design the line ends to be scaled. When the line end is applied to a line, the Size and Weight settings in the Line dialog box will have no effect on the size of a scaled line end. If your pattern isn’t scaled, Visio can resize the line end when it is applied—the height of the pattern shape’s alignment box is set to match the line weight. For this behavior to work, you must set the Begin Size and End Size to Medium (the default) in the Line dialog box when you apply the line end pattern. If you choose any other Size setting, from Very Small to Colossal, the line end is sized in the usual manner.

Figure 23-20: An unscaled line end sizes with the line weight. A scaled line weight remains the size you created it, regardless of line weight settings.

TroubleshootingA custom line end pattern doesn’t appear when you apply it to a line

If your line end isn’t visible after you apply it, and you designed it to be unscaled, adjust the line weight. Select the line, choose Format, Line, and then in the Weight box, scroll down to select Custom. Type a thicker line weight, such as 12 pt. or .25 in.

Creating Line End Patterns

To create a line end pattern, follow these steps:

  1. If the Drawing Explorer window isn’t open, choose View, Drawing Explorer Window.

  2. In the Drawing Explorer window, right-click Line Ends, and choose New Pattern.

  3. In the Name box, type a name for the pattern as you want it to appear in the Begin and End boxes for line ends.

  4. In the Behavior area, select one of the following:

    • Select in-line behavior, and the line end points in the same direction as the line.

    • Select upright behavior, and the line end stays upright as the line is moved.

  5. If the pattern will be used in diagrams with a drawing scale, select the Scaled check box.

  6. Click OK to add the new pattern to the Line Ends folder in the Drawing Explorer window.

  7. Right-click the new pattern in the Drawing Explorer window, and then choose Edit Pattern to open a new drawing page, where you can create the pattern design.

  8. Draw a new pattern, or copy a shape from the main drawing page and paste it on the pattern drawing page. If your pattern includes more than one element, group them (Shift+Ctrl+G), or use a shape operation to combine them (choose Shape, Operations).

    Tip

    If your pattern implies direction, make sure it points to the right.

  9. When you’re finished with your pattern design, click the Close button on the pattern’s drawing page window. Visio displays a message asking whether you want to update the pattern and all of the shapes that might be using it as a pattern. Click Yes to update the pattern design.

Applying Line End Patterns

The next step is to get the line end to show up at an appropriate size on a line. If you’ve designed an unscaled line end, and you apply it to a Visio line of the default size, the line ends probably won’t be visible. You’ll have to adjust the line weight.

Follow these steps to apply your line end pattern:

  1. Select a line on the drawing page, and then choose Format, Line.

  2. To apply a line end to the begin point, click the drop-down arrow in the Begin list, scroll down, and select the name of the pattern you created.

  3. To apply a line end to the endpoint, click the drop-down arrow in the End list, and choose the name of the pattern you created.

  4. If the line end is unscaled, make sure that Medium is selected in the Begin Size and End Size lists.

  5. Click Apply. Verify that the line ends have been applied in the way you want on the drawing page. Move the Line dialog box out of the way if you need to.

    Tip

    If a line has rounded ends (the default style), a gap might appear between the end of the line and the line pattern. To specify flat ends, in the Line dialog box, choose Square in the Cap list.

  6. If the line ends are too small to be easily visible (which can happen if the line ends are unscaled), click the drop-down arrow in the Weight list, and choose Custom.

  7. Type a heavier line weight (using any unit of measure Visio supports, including points, inches, and metric units), and then click OK. Visio redraws the line in the Preview area.

  8. Verify the results, and adjust the line weight again if necessary. Click Apply in the Line dialog box for a better view of the result. When you like what you see, click OK.

    Tip

    If you customize the line weight to make an unscaled line end more visible, enter a line weight that’s equal to the height of the pattern shape you created. For example, if your pattern is 1/4 inch tall, enter .25 in. for the line weight.

Категории