Better Tools 4: Productivity Tools for Process Modelling in Visio
This post provides three efficiency tools for process modelling and design work in Visio. They provide quick resizing and realignment tools for groups of shapes and a way of moving shapes without dragging its connectors as it moves.
It complements three earlier posts:
- Better Tools 1: Efficient Table Management, which describes Word tools for quickly recording content into tables and numbering the entries,
- Better Tools 2: Automated Punctuation in Microsoft Word, which describes tools for formatting and punctuating tables and bulleted lists.
- Better Tools 3: Hand-drawn Process Flows in Visio provides a set of shapes and a template using a hand-drawn style for an informal, work in progress look.
Tool 1: SmartSize
SmartSize allows you to resize a set of shapes by example and allows them to be quickly selected and resized later.
Using the Tool
First, select the exemplar shape and adjust its size. Then select the other shapes in the set. Finally, press the SmartSize shortcut key. All of the shapes will now be the same as the first one selected.
In this diagram, Component 2 and Component 3 will be resized to be the same as Component 1
The three components are now resized and have been assigned a group number so that they can be resized as a group later.
Quickly Resizing Later
Select any member of the group and adjust its size. Then press the SmartSize shortcut key. The rest of the set will be selected. Press the shortcut key again and the set is resized to the first one selected.
Resize Component 3 then press the shortcut key. The rest of the group is selected.
Press the shortcut key again and they are now resized.
Whenever a set is resized, each shape is marked internally with a group number. When the shortcut key is used and there is only one shape selected, the tool first selects all the shapes in the same set. When the shortcut key is pressed again the routine carries out the resizing action.
I use this tool whenever I am working in Visio, especially when preparing context diagrams and structural representations. In these diagrams, having consistent shape sizes as the content in each shape is added means regular adjustments. While Visio has some resizing features, they are somewhat hidden and lack the resize by example and group management features seen here.
Learning about Visio
This was the first tool I built in Visio many years ago. It uses many of the shape management concepts that are used for more advanced tools.
The size of a shape is determined by the height and width values that you can see when you view its shapesheet. The tool uses a simple loop to step through the shapes in selection set. It finds the height and width of the first shape and assigns these values to the remaining shapes in the set. The looping, variable handling, and assignment of values to the shapesheet form the basis of most other Visio programming.
Tool 2: SmartAlign
SmartAlign allows you to align a set of shapes by example and allow them to be quickly realigned later.
Using the Tool
Select a shape that has been positioned correctly. Then select the other shapes that should align to it. Then press the SmartSize shortcut key. All the shapes are now aligned through the middle of the first. There is a separate shortcut key for vertical and horizontal alignment.
In this diagram Process 3 has moved and Process 1 and Process 2 have been selected for alignment
Using the shortcut key has realigned the shapes
This diagram shows that a similar shortcut key can be used for vertical alignment.
Quickly Realigning Later
Select any member of the alignment set and move it to its new location. Then press the shortcut key to reselect the rest of the alignment set. Then press the shortcut key again. The set now aligns with the first shape selected.
Whenever a set is aligned, each shape is marked internally with a group number. When the shortcut key is used and there is only one shape selected, the tool selects all the shapes in the same set. When the shortcut key is used again, the routine carries out the alignment action.
I use this tool whenever I am working in Visio, especially when process modelling and preparing framework and structural diagrams. The ability to quickly align and realign the same set of shapes can save a lot of time, especially as the model matures and the layout adapts. The Visio tools for alignment have improved over time, and work reasonably when initially laying out a model. They are not so great for making quick changes later.
Extending SmartAlign: Automatically Selecting Shapes
SmartAlign has an extension which allows you to automatically select shapes to align. This can be used when aligning shapes for the first time, or when you have a group of shapes and want to extend it to include additional items in the same band running across or down the page.
The first time you press the extension shortcut key, the routine selects those shapes that are most closely aligned the first shape selected. Pressing it again widens the selection to include an increasingly broader set of shapes. The fourth press returns you the start point if there are shapes selected that were not intended. There is a separate extension shortcut key for both horizontal and vertical alignment.
Learning about Visio
SmartAlign extends the concepts developed in SmartSize. It shares the looping concepts but adds the ability to programmatically call the Visio functions like alignment that are seen in the UI. A quick way of getting started is to use the macro recorder and then inspect the code that Visio generates itself. Another key feature this routine highlights is the ability to create and manage the content of custom property fields. These fields are used to store the identifiers that define sets used in SmartSize and SmartAlign. When a new group is identified, the internal GUID for first shape in the set is assigned to the property value in each of the others. If the property does not exist, it is created. Later, a routine in the code selects those shapes which have the same attribute as the one selected.
Tool 3: Break Links
Break Links removes the connections to a shape so that it can be moved without dragging the connectors with it. The end points of the connectors remain in their current location so that another shape can be dropped in its place. Usually, Visio will then automatically link the connectors to the new shape.
In this diagram, Process 4 has been selected, the Smart Tool Menu shortcut key pressed to show the menu and Break Links selected
Process 4 has been moved away and Process 5 can be inserted and the connectors linked to it automatically.
I use this tool regularly, especially in the early phases of process modelling when the structure is fluid and changes are frequent. I often need to move a process shape sideways to make room for another. Dragging the shape drags its connectors too, and this can be a pain, so it can be easier to break the connectors before the move.
Learning about Visio
This routine illustrates some key features of one dimensional shapes (connectors). When unconnected to a shape, the start and end coordinates point of a connector are expressed as (x,y) positions, however when connected, these end point s refer to locations on the shape it is connected to (its parent). To break the links, the routine determines the parent location as (x,y) coordinates and assigns these to the end points. This means the connector loses is parent link, but its endpoint remains in the same place.