Designing Shapes for Automatic Layout

Microsoft® Visio® provides powerful automatic layout capabilities that position shapes and reroute the connectors between shapes based on user-selected layout options. You can control how the shapes and connectors in your solutions interact as the drawing is manipulated or in response to the Lay Out Shapes command by customizing the default parameters for the pages in your templates. You can also override the placement and routing behavior for individual masters and connectors in the stencils you design.

In this Section…

Setting Layout Options for the Page

Setting Shape and Connector Behavior

Setting Layout Options for the Page

When a user manipulates a drawing or uses the Lay Out Shapes command (Shape menu), Visio uses the values of cells in the Page Layout section of the page's sheet to determine the default routing and placement behavior for the connectors and shapes in the drawing. You can modify the values of cells directly, or by selecting options on the Layout and Routing tab in the Page Setup dialog box (on the File menu, click Page Setup).

You can also specify placement behavior for masters and individual shapes and routing behavior for connectors in the Shape Layout section in the ShapeSheet. Several of the cells in the Shape Layout section duplicate those in the Page Layout section, so you can specify local shape-specific overrides for certain global behaviors.

In general, specifying global layout options for the page and limiting the number of local overrides will make the routing behavior in your solution more consistent, and therefore more predictable for users. For example, you might specify that placeable shapes move away when another shape is dropped on the drawing as a global setting, but modify the Shape Layout section of a particular master to prevent instances of the shape from moving. Or you might specify that instances of a connector shape use a certain line style, or jump in a particular direction.

Following is a table that lists cells in the Shape Layout section that override default settings in the Page Layout section.

Shape Layout cells that override Page Layout settings

Shape Layout cell

Applies to

Determines

ShapePlowCode

Placeable shapes

Whether placeable shapes on the drawing page move away when another placeable shape is dropped nearby. Override page defaults with Plow no shapes (1) or Plow every shape (2).

ConLineJumpCode

Routable shapes

When a connector jumps. Override page defaults with Never (1), Always (2), Always to other (3), To neither (4).

ConLineJumpStyle

Routable shapes

The style for a connector jump. Override the page defaults with Arc (1), Gap (2), Square (3), Triangle (4), or multisided jumps (5-9). For details, see the ConLineJumpStyle cell in the ShapeSheet Reference in the Microsoft Visio Developer Reference (on the Help menu, click Developer Reference).

ConLineJumpDirX and ConLineJumpDirY

Routable shapes

The horizontal (X) or vertical (Y) direction for a connector jump. For horizontal jumps, override the page defaults with Up (1) or Down (2). For vertical jumps, override the page defaults with Left (1) or Right (2).

ConLineRouteExt

Routable shapes

The appearance of a connector. Override the page defaults with Straight (1) or Curved (2).

ShapePlaceFlip

Placeable shapes

The orientation of a placeable shape toward the next placeable shape it is connected to. Override the page defaults with FlipX (1), FlipY (2), FlipRotate (4), or FlipNone (8). For details, see the ShapePlaceFlip cell in the ShapeSheet Reference in the Microsoft Visio Developer Reference (on the Help menu, click Developer Reference).

ShapeRouteStyle

Placeable and routable shapes

The style and direction for a connector on the drawing page. For details about values for this cell, see the ShapeRouteStyle cell in the ShapeSheet Reference in the Microsoft Visio Developer Reference.

Note This is only a partial list of cells that you can control in the Page Layout and Shape Layout sections. See the Microsoft Visio Developer Reference for detailed information about the functions of each cell in these ShapeSheet sections (on the Help menu, click Developer Reference).

TOP

Setting Shape and Connector Behavior

When you create a new master, its Shape Layout settings reflect the current page defaults. You can modify these settings to define how instances of a master interact with other shapes when a user manipulates a drawing or clicks the Lay Out Shapes command (Shape menu). For example, you might want to allow shapes to be placed on top of a certain shape, rather than moving away from it. Or you might want to allow connectors to route through certain shapes rather than around them.

The same applies to connector shapes: You can modify the behavior of dynamic connectors to provide more custom interactions during automatic shape layout. For example, you might want to prevent certain connectors from jumping, or you might want to specify a certain line jump style for connectors that are allowed to jump.

When you design masters, you might also want to specify custom behavior for connection points. Connection points can have an associated direction, which controls how connectors attach to the shape. By manipulating the direction of a connection point, you can control even more closely how connectors attach to that shape.

Note Connection point direction options are available only when you are running Microsoft Visio in developer mode (on the Tools menu, click Options, click the Advanced tab, and then select Run in developer mode).

To change the direction of a connection point

  1. Choose the Connection Point tool (Aa201732.ic_connectPt(en-us,office.10).gif) from the Standard toolbar, and then click to select a connection point.
  1. Right-click the connection point and select a direction from the shortcut menu. Outward cannot be used for point-to-point connections.
  1. Click and drag the gray triangle attached to the connection point to specify a direction. When the connection point has been activated, the triangle turns green.

Changing the direction of a connection point determines how connectors attach to that shape.

Changing the direction of a connection point determines how connectors attach to that shape.

  1. If you want the connector to attach to the outside of the shape, drag the Inward connection point circle inside the shape.
  1. Outward connection points cannot be connected to, and serve only as points for snapping the shape to another shape.
  1. Inward & Outward connection points provide versatile connection options.