Our previous post on AutoConnect in Visio 2010 discussed how Visio 2010 makes it simpler and faster for end users to create connected diagrams such as flowcharts. Many developers will be pleased to hear that Visio 2010 also brings greatly simplified utilities for working with connected diagrams programmatically. The Visio 2010 API contains new methods that let developers manipulate and traverse connected diagrams or graphs at a higher level of abstraction than previously, which can result in greater programmer productivity and more concise, readable code.
In this blog post, we will introduce the new Visio 2010 methods used for working with connected diagrams. Then we will see these methods in action by doing a visual walk-through of a program that manipulates a flowchart. (The source code and diagram used below are also available for download here.)
For each of the following API methods, we give a brief description on what the method does, along with an explanation of the method’s arguments. This is not meant to be a complete reference; the forthcoming Visio 2010 SDK will contain much more complete documentation on these methods.
Returns an array of identifiers (IDs) of shapes that are one degree of separation away from the given shape (i.e. separated by a 1-D connector).
Returns an array of identifiers for the shapes that are glued to a shape. For instance, if the given shape is a 2-D shape that has multiple connectors attached to it, this method would return the IDs of those connectors. If the given shape is a connector, this method would return the IDs of the shapes to which its ends are glued.
Creates a new Shape object on the page, places the new shape relative to the specified existing target shape, and adds a connector from the existing shape to the new shape. Returns the newly created shape. This feature parallels the AutoConnect feature in the Visio user interface.
Splits the specified connector with the specified shape. Returns the new, duplicated connector.
Unglues the specified connector end points and offsets them the specified amount from the shapes they were joined to.
Automatically draws multiple connections in the specified directions between the specified shapes. Returns the number of shapes connected.
Here is a screenshot of a Visio drawing we will be manipulating and traversing:
Using a few of the above listed methods, we’ll add to this flowchart and traverse it. Each step along the way, we’ll show you the corresponding line of C# code along with a screenshot of the change it caused.
Note: In the below code snippets, page refers to the active drawing page, and the Visio namespace is an abbreviation of Microsoft.Office.Interop.Visio. The meanings of most other variables should be apparent from the context.
First, let's split the connector that currently connects "Start Event" to "Task" and insert a Sub-Process shape. We can access that connector using the GluedShapes method. Once we’ve accessed the connector, we use SplitConnector to split it.
Array shapesGluedToStartEvent = startEvent.GluedShapes(Visio.VisGluedShapesFlags.visGluedShapesOutgoing1D, "", null); // In this example, the above array has 1 element. Let's get that element. int splittableConnectorID = (int)shapesGluedToStartEvent.GetValue(0); Visio.Shape splittableConnector = page.Shapes.get_ItemFromID(splittableConnectorID); page.SplitConnector(splittableConnector, subprocessMaster);
This yields the following result:
Let's say we want to programmatically access the "Task" shape. If we have a reference to "Start Event", we can access "Task" by traversing across "Sub-Process", using ConnectedShapes.
Array shapesConnectedToByStartEvent = startEvent.ConnectedShapes(Visio.VisConnectedShapesFlags.visConnectedShapesOutgoingNodes, ""); // In this example, the above array has 1 element. Let's get that element. int subProcessID = (int)shapesConnectedToByStartEvent.GetValue(0); Visio.Shape subProcess = page.Shapes.get_ItemFromID(subProcessID);
// Repeating the same action as above to get from "Sub-Process" to "Task". Array shapesConnectedToBySubProcess = subProcess.ConnectedShapes(Visio.VisConnectedShapesFlags.visConnectedShapesOutgoingNodes, ""); int taskID = (int)shapesConnectedToBySubProcess.GetValue(0); Visio.Shape task = page.Shapes.get_ItemFromID(taskID);
Now let's use DropConnected to drop an End Event shape onto the page and have "Task" connect to it. We use the default connector, so the last argument can be null.
Visio.Shape endEvent = page.DropConnected(endEventMaster, task, Visio.VisAutoConnectDir.visAutoConnectDirRight, null);
We hope this walk-through was a helpful illustration of Visio 2010’s new API utilities for working with connected diagrams. This article covers only a small part of the enhancements made to Visio’s API for the 2010 release; more information will come in future posts on this blog, and with the release of the Visio 2010 SDK.
We’re interested to hear what developers think of this API functionality, so please use the Send a Smile feedback tool or leave a comment below.
One of the guiding principles for the Visio 2010 user interface is that commonly used shapes should be easily accessible. We showed how the Quick Shapes view in the Shapes Window aggregates the shapes from multiple stencils together. There are also common shapes that are useful in many different kinds of diagrams. These are exposed directly in the Ribbon through shape galleries. We looked at Containers and Backgrounds and Borders previously. In this post we examine Callouts.
A callout is an annotation on a diagram that provides more information about a shape. Callouts are Visio shapes themselves, which differentiates them from other forms of annotation such as comments. Callouts are part of the visible drawing and can be edited and formatted like any other shape. A callout points at or references another shape, which we call the “target” of the callout. It is placed in proximity its target and may have a line connecting to it. The connecting line is called a “leader”.
To add a callout shape in Visio 2010, select the target shape on the page and then click on the Callout dropdown in the Insert tab. You will see the Callout gallery with many different styles of callouts. Hover over a style to see it applied as a Live Preview and then click the style to add the callout. The callout appears slightly above and right of the target shape. (Note in the Technical Preview build the callout is placed a little too close by default and overlaps the target. This will be corrected in the next beta release.)
Callout shapes are not new to Visio 2010, but Visio 2010 gives callout shapes special behaviors. When a target shape is moved, copied or deleted, any callouts attached to the shape will be moved, copied or deleted too. Thus callouts stay with their target shapes, though you can reposition the callout to any offset from its target. Callout shapes are also designed to be displayed in front of other shapes. Even if you add new shapes to a page and overlap them with callouts, the callouts will appear in front.
There are additional options for the visual style of callout shapes, which you can access by right-clicking on a callout. The Callout Style flyout menu allows you to switch to a different geometric style and has the same choices as the Insert Callout gallery in the ribbon. The Orientation flyout menu lets you control which side the callout’s leader attaches to. Callout Line controls the visibility and placement of the leader line. Finally you can choose whether the callout shape resizes to fit the amount of text in the shape.
We hope you find the improved callout behaviors and convenient access from the ribbon a welcome addition to Visio 2010. Feel free to tell us what you think through the Send a Smile feedback tool or by commenting on this post.
In the previous post we introduced the Bubble Chart diagram and demonstrated a quick way to create one using the BubbleChart.vss stencil. This stencil was custom-built for the blog, so grab the file attachment from the previous post. Now we build the stencil from scratch to understand how to integrate Visio 2007's Data Connectivity features with shape design.
There are two shapes in the BubbleChart.vss stencil: Bubble Chart and Bubble Data. Bubble Chart is the background shape that defines all the parameters of the chart. Bubble Data is the circle shape added for each row of data displayed. There's a third player that is critical to making the bubble chart work without the need for code - the Page. In this solution the Bubble Data shapes do not have to know anything about the Bubble Chart shape. The page acts as the central property store for the chart, avoiding any messy configuration between the chart and the bubbles.
First, we create the stencil. Launch Visio and create a new blank page. Then create a new blank stencil. Right-click in the Shapes window and choose New Master. Enter Bubble Chart and click OK. Right-click again to create a new master shape called Bubble Data. Go ahead and save the stencil to name it BubbleChart.vss.
Now we flesh out the Bubble Chart master shape. Double-click the shape in the Shapes window. We start with the page itself. The page will store all the parameters needed for the chart. Any page properties added here will be replicated on the drawing page once the master shape gets dropped. Go to Window > Show Shapesheet to edit the Pagesheet - the Shapesheet for the page. Next go to Insert > Section. Choose User-defined cells then click OK.
Scroll down to find the newly added section. We need to store nine property values. Right-click and choose Insert Row eight times. Now we can name each property by clicking on the red row heading and typing. Enter the nine property names and some default values as shown in the picture.
Let's look at the properties we're defining. The chart has an X axis and a Y axis. For each axis there is a minimum value and a maximum value. The first four properties will be set by the user. These are the ranges that will correspond to their data. The second four properties describe the location of the chart on the page. They are set by the BubbleChart shape. Note that the values of these properties have a measurement unit. Both sets of four properties describe the same points - one from the user's perspective and one from Visio's. The last property is the size factor. We need to know how big to make each bubble on the chart. The size factor is a simple way to record a scale. Using the default value 10 as an example, a bubble with a Size of 10 in the data set will have a diameter of 1 inch in the chart.
Now that the page is set up, let's make the chart shape itself. Close the Shapesheet window for the page and draw a rectangle. Then go to Window > Show Shapesheet to open the rectangle's Shapesheet. There are several things to do here. We need to capture some chart information from the user. This will be done through Shape Data. Other information comes from the shape itself. We'll use User-defined cells to track this information. Go to Insert > Section and check the User-defined and Shape Data boxes, then click OK.
We need four User-defined cells to store the page coordinates related to the chart boundaries. Add three more rows using right-click > Insert Row. We'll use the same row names as in the Pagesheet. Next we need to enter formulas to calculate the values from the shape transform. The bottom left corner of a shape can be found by taking the shape's Pin and subtracting its LocPin. This is done for both X and Y. The upper right corner can then be found by adding the shape's Width or Height the minimum values. So we know the page coordinates for the chart, but we need these to be stored in the page not the chart shape. We use the function SETF to push the values to the matching User-defined cells in the Pagesheet. SETF takes two parameters. First comes a reference to the target cell, which is retrieved using the GETREF function. Second is the value to be pushed, which is the chart page coordinates. Enter the row names and formulas as shown in the picture.
The remaining properties are stored in seven Shape Data rows. Right-click in a Shape Data row and choose Insert Row six times. The first four rows will match the Pagesheet names for the data ranges. Then we add two new rows for X and Y axis labels. The final row matches the size factor property from the page. In the Shape Data section, the Label column stores the friendly text that appears in the Shape Data dialog. The Type column specifies the data type. Enter 2 for the numeric properties and 0 for the string properties. Again we need to push the values to the User-defined cell s in the Pagesheet. In this case SETATREF is a good choice. The function essentially forwards any value entered to the cell referenced in the function. Enter the Shape Data information as shown in the picture.
To prompt the user to fill in the Shape Data properties when the shape is dropped, we use a little trick involving the SETF function. Normally you just need to set the Ask property in a Shape Data row to pop up the Shape Data dialog on drop. However, Ask will display the dialog when the shape is either dropped or copied. In our case, we would prefer not to see the dialog on a copy because the properties are already set. An alternate mechanism is to put a formula in the EventDrop cell of the shape. Scroll down to find the EventDrop cell in the Events section. DOCMD(1312) is the command code for the Shape Data dialog. This command will fire when the shape is dropped. To prevent further events from triggering the dialog, SETF is called. We set a zero in the EventDrop cell itself. Thus the formula can wipe itself out.
At this point we have all the functionality of the Bubble Chart shape defined. In the next post, we complete the master shape by adding labeling.
Diagram maintenance is a task that everyone performs, and many users spend much of their time in Visio maintaining existing diagrams. We realize that a fair amount of the time you spend maintaining your diagrams is spent in the mechanics of the task, rather than achieving the goals of updating the concept the diagram represents. There are some clear gains we can effect to make your life easier as you go about editing your diagrams.
Consider a typical flowchart. You documented an internal process and now need to add some steps to the process diagram. Prior to Visio 2010, this meant facing what could be a tedious task of ungluing connectors, selecting and dragging shapes to make room for the new ones, adding the new ones, positioning them neatly, re-gluing connectors, adding new connectors and moving the other shapes into position to leave you with a nice, neat diagram.
In Visio 2010, as part of our focus on ease of use and improving core process diagramming, we have simplified this basic, repeated task dramatically. Now, all you need to do is drag your new shape out and drop it on the connector you wish to split. Visio highlights the endpoints of the connector to make it clear which connector will split. When you drop, Visio moves all the “downstream” shapes over just enough to make room for the new shape. Visio takes care of positioning the new shape so that it is aligned with and evenly spaced from the shape upstream from it.
Visio identifies which shapes are “downstream” from the insertion point, moves them in the right direction the right amount and places the new shape in just the right spot. The lower left rectangle is connected downstream from the inserted shape, but is to its left, so did not need to move.
At some point you may need to remove a few steps from your diagram. Prior to Visio 2010, this meant deleting shapes, deleting excess connectors, re-gluing the remaining connectors to the remaining shapes and moving those shapes to align and space evenly with the rest of the diagram.
In Visio 2010, we take care of the connector healing for you. When you delete a connected shape, Visio checks how many connectors go into and out of the shape, and which ones have text. If it is clear how to re-glue the connectors without changing the diagram and which connectors can be removed without losing text, Visio deletes the extraneous connectors and re-glues the remainder.
We made an explicit decision not to move the remaining shapes to fill in the empty space, as that could easily lead to all those downstream shapes – which could be numerous – overlapping another part of the diagram. Fortunately, you can simply select which shapes should tighten up and use Auto Align or Auto Space to help you neaten up the diagram. As you can see above, we also preserve connectors that have text, even when that means not healing. Text on connectors is important, so better safe than sorry.
As mentioned, we enabled this behavior for cases where we can make a safe conclusion about how the connectors should heal. Other than to prevent losing text, when else don’t we try to heal? If there is more than one connector coming into and going out of the shape being deleted, then it is ambiguous how all the shapes should be re-connected together. Typical examples of this are shown below.
Our hope is that these additions, while seemingly small, will have a big impact on reducing your workload as you maintain the millions of Visio diagrams you have all created. Let us know how this works for you using Send a Smile or through a comment on the blog.
We're going to wrap up our look at Visio's essential features with the most significant innovation of all - the SHAPE.
Essential Feature: Shapes
A central concept in Visio is assembling a diagram from a pre-packaged set of content. Users do not need to construct drawings from scratch using geometric primitives, nor do they need to be artists to draw great-looking symbols. You only have to find a shape in one of Visio's stencils and drag it into the drawing.
Visio shapes differ from Clip-Art in three important ways:
· Shapes are vector-based graphics meaning that they size and scale well (yes, some Clip-Art is vector-based too).
· Shapes can have behaviors that control their appearance or interactivity with the user.
· Users can customize shapes or build new ones from scratch to easily create new content.
We refer to Visio's content as SmartShapes because they react in an intelligent manner when you manipulate them in a diagram.
There are many, many things to say about designing and using shapes in Visio, but for now let's look at one shape in particular. Looking back at the history of Visio, you could say it all began with a single SmartShape - the block arrow.
If you want to see an example of this shape in the current product, open the Basic Shapes template (File > New > Block Diagram > Basic Diagram) and drag out the 45 degree single shape from the Basic Shapes stencil. There are two special behaviors on this shape. First, you can stretch the width of the arrow without affecting the size of the arrowhead. Second, you can control the size of the arrowhead by changing the height of the shape. These behaviors preserve the 45 degree angle of the arrowhead across a wide range of shape sizes.
Compare this resize behavior to a standard symbol. Every arrowhead has a different angle.
How does this work? Every Visio shape is actually a collection of properties that are defined using parametric expressions. Unlike many objects that have properties with static values, a Visio shape has properties with either a static value or a dynamic value that is calculated from a formula. Other shape properties are often used as parameters in the formula, and that gives the shape its behavior. For example, I can make a rectangle whose Width property is a function of Height. If I set Width = Height * 2, then I have made a behavior that changes the Width automatically whenever the user adjusts the Height of the shape.
Visio shapes have hundreds of properties, each of which can have a formula. These properties are organized into a spreadsheet interface called the ShapeSheet. Just as in a spreadsheet, the properties are called Cells in the ShapeSheet. Cells are organized into rows, columns and sections. See for yourself. Select the arrow shape on the page and choose Window > Show ShapeSheet from the menu. The ShapeSheet Window opens, showing you the real power behind shapes.
If you look at the ShapeSheet for the 45 degree single arrow shape, you can see some of the parametric formulas that give this shape its special behaviors. The 1-D Endpoints section tracks the current begin and end points of the arrow. The Shape Transform section has formulas that depend on the endpoints. For example, the Width of the shape uses the Pythagorean theorem to compute its value from the endpoints.
The Geometry section lists the points that make up the line segments you see on the screen. If you tile the drawing window and ShapeSheet window together (Window > Tile), you can select a cell in the Geometry section and Visio will highlight that point on the arrow in the drawing window. Notice that all these points are expressed in terms of Width and Height and also a pair of Scratch cells. The smarts behind this arrow shape are found in the Scratch.X1 cell. This cell has a formula that determines the correct size of the arrowhead in order to maintain a 45 degree angle.
One of the best ways to learn how to make shapes is to look at the ShapeSheets of existing Visio shapes. You can see the formulas those shapes use. You may just need to customize an existing shape slightly to make the SmartShape you want. There are thousands of shapes that ship with Visio. Or you may want to make a shape from scratch incorporating behaviors you discovered in other shapes. The ShapeSheet is a powerful tool that Visio exposes to all users so that they can create shapes that have the visual appearance users need and behaviors that make diagramming with them easy.
A new series of training videos have been posted on Office.com to introduce Visio users to Business Process Modeling Notation (BPMN). The videos are packaged as a course named BPMN Diagramming Basics.
The course provides both an introduction to the BPMN notation and a tutorial on creating BPMN diagrams with Visio 2010 Premium. Along the way you can see some of the other new features of Visio 2010 including Swimlanes, AutoConnect, Subprocesses, and Diagram Validation. The complete course takes less than 30 minutes to view.
Please remember that the BPMN, Subprocess, and Diagram Validation features are part of the Premium Edition of Visio 2010.
Be sure to let us know what you think!
The Visio team is pleased to announce that the online version of the Visio 2010 SDK documentation is now available here. This documentation, which also shipped with the Visio SDK download, is intended to help developers working with the Visio APIs, ShapeSheet and XML. It contains the following Visio developer references.
For Visio Services developers, documentation is available online as well as offline via the Microsoft SharePoint 2010 SDK. This documentation is divided into Visio Services in SharePoint Server overview articles and Visio Services Class Library technical information, and covers the following topics.
As always, we enjoy hearing your feedback about Visio, the Visio SDK and our documentation. Please feel free to post any questions or suggestions to our blog.
Microsoft has released Service Pack 3 for the Visio 2003 product. You can download the pack here:
(If English is not your install language, you can change to another one on the web page.)
The set of changes is described here:
The majority of the changes in this release are security and reliability related as Visio 2003 gets much of the same hardening that has gone into more recent versions. There are also a number compatibility fixes to help Visio 2003 work with newer products such as IE7, Vista, SQL 2005 and even Visio 2007.
In particular the hyperlink problem with IE7 as described in this previous post has been corrected.
This update also applies to those running Visio for Enterprise Architects in Visual Studio 2005. A number of fixes have been made to the Software / Database functionality that resides in Visio Professional as well as VEA.
And finally no update to Visio 2003 would be complete without addressing a printing problem. Visio 2003 has had more than its fair share of printing issues. SP3 fixes a problem with very long plotter pages.
This is a beefy download at 48MB but definitely recommended.
Today is a holiday in the US, so we're republishing this topic from a newsgroup post not too long ago.
Summary: You can add the User.visEquivTitle cell to your shape and provide a string that will display as a tooltip in HTML web output. The shape must also have at least one custom property for the tooltip to be visible.
Steps: 1) Select the shape in your drawing that you want to add a web tooltip for 2) Go to Window > Show Shapesheet 3) Go to Insert > Section, check User-defined cells and click OK 4) In the newly created section, click on the row name User.Row_1 to select the title of the row 5) Type visEquivTitle and press Enter - you should now see User.visEquivTitle for the row 6) In the Value cell of that row, enter the text you want to display surrounded by quotes (e.g. "Hello World") 7) If you instead want to display the same tooltip as the Shape ScreenTip enter =Comment (no quotes) 8) Go to Insert > Section, check Custom properties and click OK 9) You can fill in the custom property Label and Value if you want this information to be visible 10) If you don't want the custom property to be visible, enter TRUE in the Invisible cell 11) Close the Shapesheet window and repeat for any other shape you like 12) Choose File > Save as Web Page to create the HTML output
As you can see this is a bit involved. The capability was designed more as a developer feature than an end user feature. We recommend tying the Shape ScreenTip to the User cell so that you see the same tooltip in both Visio and the web output. It should also be possible to use Macro Recorder to automate these steps. If your shape has a custom property but does not have the User.visEquivTitle cell, Visio will display the shape's text in a tooltip instead.
In a previous blog post, we told you about the new Connectivity APIs in Visio 2010 that make it easier for developers to create and to move across a connected diagram. We’ve shown you how to use some of the new APIs to create new connected shapes (see here); now we’ll examine techniques for traversing connected diagrams. One of the most useful APIs for analyzing a connected diagram is the Shape.ConnectedShapes method, which allows you to get a reference to the shapes connected to a shape.
Let’s take a look at a specific scenario to demonstrate how this method can be used to walk through a connected diagram. Imagine that you have a simple project plan, created using the Basic Flowchart template:
In the shape data, each task in the flowchart includes a start date and an end date by which the task must be completed (shown in the chart below).
“Assess needs for project”
“Is project well-defined?”
“Build a prototype”
Ideally, no task in this project should start before the previous task has been completed. You could select each shape and compare the start and end dates in the Shape Data window, but the process would be very manual and tiresome. You could even use Data Graphics to display the start and end dates next to each shape, but it would still require visually inspecting each pair of connected shapes in the drawing.
With the ConnectedShapes method, however, you can write code that walks through each connected shape in your drawing and examine the shapes connected to it. The method returns an array of the shape IDs of all the shapes connected to a shape, filtered by the type of relationship between the shapes (e.g. is the connector “going out” to the other shape or “coming in” from the other shape?). You can also narrow down the returned IDs further by specifying a shape category as an additional filter.
Here’s some simple VBA that will iterate through each connected shape in a diagram and change the fill color of a connected shape if there is unwanted overlap between its start date and the task “before” it.
Dim vsoPage As Visio.Page Dim shapeList Sub TraverseFlowchart() Dim vsoShape1 As Visio.Shape Dim shapeIDArray() As Integer Dim searching As Boolean Set vsoPage = Application.ActivePage Set vsoShape1 = vsoPage.Shapes("Start/End") Set shapeList = CreateObject(“Scripting.Dictionary”) shapeList.Add vsoShape1.Name, 1 GetConnectedShapes vsoShape1 End Sub Sub GetConnectedShapes(shape As Visio.shape) Dim outgoingShape As Visio.shape Dim shapeIDArray As Variant Dim shapeIDArrayNext As Variant Dim outgoingNodes As Integer Dim node As Integer Dim prevTaskEnd As Date Dim nextTaskStart As Date Dim beenChecked As Boolean prevTaskEnd = shape.Cells("Prop.EndDate").result(visDate) shapeIDArray = shape.ConnectedShapes(visConnectedShapesOutgoingNodes, "") If (UBound(shapeIDArray) >= 0) Then outgoingNodes = UBound(shapeIDArray) For node = 0 To outgoingNodes Set outgoingShape = vsoPage.Shapes(shapeIDArray(node)) nextTaskStart = outgoingShape.Cells("Prop.StartDate").result(visDate) Debug.Print shape.Name & " end: " & prevTaskEnd & "; " & _ outgoingShape.Name & " start: " & nextTaskStart If (nextTaskStart < prevTaskEnd) Then outgoingShape.Cells("FillForegnd").Formula = "RGB(255, 0, 0)" End If shapeIDArrayNext = outgoingShape.ConnectedShapes(visConnectedShapesOutgoingNodes, "") beenChecked = shapeList.Exists(outgoingShape.Name) If ((UBound(shapeIDArrayNext) >= 0) And Not beenChecked) Then shapeList.Add outgoingShape.Name, 1 GetConnectedShapes outgoingShape End If Next node End If End Sub
If we run this code on the project plan shown above, we get a result as shown below. Notice that the two shapes that have start dates that are earlier than the previous tasks’ end dates have a red fill applied to them.
In the code sample, the GetConnectedShapes subroutine uses the ConnectedShapes method on the shape passed in as an argument to get an array of the shape IDs (integers) of the shapes that it connects to. (That is, the shape contains the beginning connection of a connector that points to the shapes referenced by the IDs in the array.) Then the subroutine iterates through each shape referenced by the IDs in the array. Next, the value of the “Prop.StartDate” cell of each attached shape is compared to the “Prop.EndDate” cell of the first shape. If the values overlap, the value of “FillForegnd” cell is changed to red.
This code sample also uses the ConnectedShapes method to traverse the connected diagram in a manner similar to “walking” a tree data structure, starting from a specific shape (the first Start/End shape). After it analyzes a shape and one of its attached shapes, the GetConnectedShapes subroutine checks whether the attached shape has any shapes that it connects out to (making another call to ConnectedShapes). If so, the subroutine makes a recursive call to itself (and thereby halting the execution of the original call), passing in the attached shape as an argument. In practice, it is likely that you will need to use this programming technique in conjunction with the ConnectedShapes method in order to work all the way through each shape in a large connected diagram.
(Also notice that the code sample keeps track of each shape whose outgoing nodes have been checked by adding the shape to a dictionary object before the GetConnectedShapes subroutine is called. This will prevent the code from becoming stuck in an infinite loop if the diagram includes a circular reference.)
Even though we’ve used a project plan scenario as the example in this code sample, there are many other practical applications for this technique. In a related but larger sense, you could incorporate this technique within a custom validation checker to determine whether a connected diagram has been constructed correctly. Also similar to the code sample above, you could use this technique to extract and store data from each shape in a connected diagram. (Extending the project plan example, you could get the duration from each task in the workflow and then create a total of all the resource hours needed for the project.)
In the next blog post, we’ll look at another way that you can use this technique and the Page.SplitConnector method to add new shapes to a connected diagram.
The Service Pack 3 (SP3) update for Visio 2007 is now available. It includes a variety of new security, stability and performance improvements as well as all previous updates and hotfixes released through August 2011. The SP releases are cumulative, so it is not necessary to apply any earlier service pack releases to get all previous updates.
A number of issues that have been addressed in previous hotfixes are included in this SP. The most significant of these are:
A full list of addressed issues can be found at http://support.microsoft.com/kb/2526291.
This service pack also addresses an issue involving Bluetooth add-ins which could cause recurring crashes in some machines running specific versions of a Bluetooth add-in. These add-ins are commonly installed by default on new laptops and PCs.
If a Bluetooth “Send to Office” add-in is installed, Visio may crash at the start of a session, during copy/paste, or on exit. This crash is often frequent and persistent on affected computers and may prevent use of Visio.
In order to correct this problem, Visio 2007 SP3 moves any Bluetooth add-in to the disabled add-ins list, and the add-in is not re-enabled in subsequent sessions. Once a Bluetooth add-in has been moved to the disabled add-ins list, the “Send to Office” functionality is disabled and no longer available. A disabled Bluetooth add-in can be re-enabled manually or manufacturers can override the disabling code during the installation to prevent the Bluetooth add-in from ever being disabled.
Detailed instructions to re-enable or override this behavior can be found at http://support.microsoft.com/kb/2621762.
The Visio SP3 and instructions for installation can be found at http://support.microsoft.com/kb/2526291.
Thank you for your continued feedback on Visio. If you have additional comments for the product team, please add them below or e-mail us a message.
In Visio 2007, we introduced the Themes feature to make it easy to apply a professionally designed look to a diagram. In Visio 2010, the Themes feature gets a whole new user interface that takes advantage of the Office Fluent UI. The theme choices are displayed in a gallery on the Design tab in the ribbon.
An improvement over Visio 2007 is that you can apply both theme colors and effects with one click on a thumbnail in the main Themes gallery, instead of having to visit two separate task panes. Each thumbnail is a pairing of a color scheme from the Colors gallery and an effect scheme from the Effects gallery.
As in Visio 2007, the color schemes include colors for text, fills, lines, connectors, shadows, and backgrounds, as well as a collection of five accent colors. The effect schemes include the font used in text, as well as formatting for the fills, lines, connectors, and shadows.
If none of the theme pairs in the main gallery are to your liking, you can choose from any of the schemes in the Colors or Effects galleries, which are located next to the main gallery.
As in Visio 2007, you can also click “Create New Theme Colors” or “Create New Theme Effects” at the bottom of the gallery to create your own custom theme.
Themes is one of the features that demonstrate the Live Preview capability of the Office Fluent UI. As you move the cursor over each thumbnail in the gallery, the theme’s formatting is previewed on your diagram. This lets you quickly experiment with various looks without forcing you to commit to the change. If you don’t click on anything, the diagram reverts back to whatever was applied before the preview.
Live Preview helps break the repetitive “Undo” cycle of applying formatting to content, deciding against the formatting change, choosing Undo to return to the original formatting, and then starting the cycle all over again.
Live Preview is available for many other galleries and menus in Visio 2010. Another feature that makes good use of it is the Containers feature discussed in an earlier post. When you move the cursor over the various container designs in the Container gallery on the Insert tab, the container style is previewed on the selected shapes so you can see what it would look like if applied.
If you’re running the Visio 2010 Technical Preview, check out the new Themes user interface and Live Preview and let us know what you think via Send a Smile or a comment on the blog.
The Visio 2010 user interface has been completely revamped this release based on the Office Fluent or “Ribbon” UI. The Office Fluent UI represents a dramatic departure from the overloaded menu and toolbar design model of previous Visio releases. Visio’s extensive capabilities are now organized into logical, easy to find groups that help you accomplish tasks efficiently rather than choosing features.
There are several design elements that comprise the Office Fluent UI.
The Ribbon replaces menus and toolbars as the place to find functionality organized to help you accomplish tasks. You’ll find the many features that Visio 2010 has in common with other Office applications on Ribbon tabs of the same name.
Here’s a brief breakdown of each of the core tabs across the Visio 2010 Ribbon.
The Home tab contains the most common and frequently used drawing tasks and tools: cut/copy/paste from the clipboard, formatting text and shapes, drawing tools, and shape arrangement.
The Insert tab is where you introduce new elements into a drawing: pages, pictures, clip art, CAD drawings, as well as new Container and Callout shapes.
The Design tab includes everything you might change for an entire page: page orientation and size, themes, backgrounds, borders and title blocks, layout commands, and connector styles.
The Data tab provides everything you need for linking external data to drawings and shapes, displaying that data with data graphics, and generating legends to show the meaning of data graphics.
The Process tab includes functionality focused on the creation of business process diagrams: simplified creation of subprocesses, validation of diagrams based upon defined rules, import and export of SharePoint workflows.
The Review tab includes proofing and language tools as well as functionality for inserting and managing comments and other markup when reviewing diagrams.
The View tab is where all drawing and visual aids that assist diagram creation, such as rulers, grid, AutoConnect, and Dynamic Grid are turned on or off.
At the bottom of the application window is the new Status Bar. The right side of the Status Bar includes convenient controls for quickly adjusting the zoom level of the Visio drawing, switching into Full Screen mode, or switching between open drawings.
The left side of the Status Bar includes status items related to what you’re working with. Beyond merely showing status, these items help you take actions. For example, if you need to set the width of a shape, simply select it and click on the Width status item. The Size & Position window is opened with the Width value already selected.
In the upper left corner of the application window is the Quick Access Toolbar, into which you can add the commands you use most frequently, eliminating the need to switch to the Ribbon tab on which they are located while creating diagrams.
This post is merely an overview of the primary Office Fluent design elements you’ll see in Visio 2010 Technical Preview. Stay tuned for future posts that will explore the new design in greater detail.
We're interested in your feedback on the new Office Fluent UI design in Visio 2010 Technical Preview, so use the Send a Smile feedback tool or comment on the blog to let us know what you think.
Last week on the Office Engineering Blog, Microsoft confirmed the release dates for Visio 2010, Office 2010, SharePoint 2010, and Project 2010.
We’re happy to announce that Visio 2010 and the rest of the Office suite will release to manufacturing (RTM) next month.
Consumers who purchase and activate Office 2007 or Visio 2007 will be able to download corresponding Office 2010 or Visio 2010 products at no additional cost when they become available in June 2010.
All you need to be eligible for this program – Office 2010 Technology Guarantee – is the following:
For more information about the Office 2010 Technology Guarantee, and to sign up for an e-mail reminder when Office 2010 is available, visit www.office.com/techg.
As always, let us know in the comments if you have any questions or topics you’d like to see us discuss here in the future.
Microsoft has published a new technical article on MSDN about the Structured Diagram capabilities of Visio 2010. Structured Diagrams help you organize the contents of your diagrams using intuitive, logical relationships between shapes. These capabilities are exposed as the Containers, Lists, and Callouts features in Visio 2010.
The article covers these topics:
Readers of the Visio Insights blog will be familiar with much of the article, since it is based on a number of previous posts. However, some of the details on Lists are new. For reference, here are the related Visio Insights posts:
Please let us know if you have any feedback on Visio 2010, Visio Services, or suggestions for blog posts you would like to see.
There have been several newsgroup postings about using VSTO to create Visio Add-ins. The deployment of these add-ins can be especially challenging. There is a new developer article by Chris Castillo detailing how to write VSTO add-ins for Visio. Chris explains why using VSTO is desirable and aggregates information from a number of sources to walk you through the development and deployment process.
There have been several newsgroup postings about using VSTO to create Visio Add-ins. The deployment of these add-ins can be especially challenging. There is a new
When Office 2007 was introduced, a new UI paradigm was adopted, and so was a new UI extensibility model, the RibbonX (Ribbon extensibility) model. RibbonX is a XML markup that allows developers to customize the Office UI. It enables 3rd party developers and solution providers to build custom tabs and groups on top of the Ribbon, and target scenarios unique to and optimized for their customers. As Visio 2010 adopts the Fluent UI, Visio developers now also have the opportunity to utilize this platform to build and customize Fluent UI to offer users a more discoverable and instructive UI experience.
Existing Visio Solutions
There are two existing mechanisms for UI extensibility in Visio: CommandBar and UIObject. Both would still work in Visio 2010: Visio 2010 automatically creates a new tab called “Add-Ins” with groups for these existing menu commands and toolbar commands and requires no extra work from developers. Here, as an example, we see a top-level menu item called Process Analysis.
In the Ribbon, this menu becomes a drop-down control that opens to show the menu commands. This automatically-generated tab and its controls require zero-effort for your solutions to migrate to the next release of Visio.
Although the migration to ribbon can be zero-effort, this really is an ideal opportunity for solution developers to re-think their UI from a Ribbon perspective. The Ribbon provides contextually-relevant commands, and presents them in a way that is more results-oriented. Your UI can integrate more seamlessly with the rest of Visio, and look more like Office. Here is an example of how Visio 2010 reconfigured the Gantt Chart UI, allowing users to more easily discover commands and learn about them through controls of varying sizes, big icons and super tooltips:
Note, if you are using UIObject in your solution, we especially recommend upgrading to the ribbon. UIObject is a legacy Visio-specific model for defining UI and it may become deprecated in the future.
RibbonX for Different Types of Add-in Technologies
Depending on what add-in technology you were using, Visio provides a number of ways to import Fluent UI controls through RibbonX and improve users’ experience. Here is how you achieve that for each type of add-in technology.
If you’re developing a Visual Studio Tools for Office (VSTO) add-in, you will have access to a visual Ribbon designer that provides a graphical construction environment, similar to other Visual Studio designers. Alternatively, you can specify your UI using RibbonX. Your add-in merely provides an override called CreateRibbonExtensibilityObject that returns an instance of your ribbon object. One-line, very simple to do.
If you’re writing a shared COM add-in, in your Connect class (the class that implements IDTExtensibility), define an override called GetCustomUI that returns your RibbonX XML as a string. GetCustomUI is the single interface through which the Fluent UI communicates with a COM add-in. Two-to-three lines, still very simple to do.
VSLs, or legacy Visio add-ons, may also use RibbonX. You add the RibbonX XML to your add-on’s resources. Your add-on defines the GetCustomUI callback and notifies the Visio Application that it has RibbonX XML by calling RegisterRibbonX.
For VBA, you simply provide the contents of a RibbonX XML as a string directly to Visio through the CustomUI property.
RibbonX and Visio XML file format
The Visio XML file format (*.vdx) may also contain RibbonX. The RibbonX markup is stored inside a new element in the Visio XML schema, called, unsurprisingly, RibbonX. The customUI element is the top-level wrapper element in the RibbonX schema.
Since you can define custom UI directly in the Visio XML file, you have all the benefits of being able to read and write the file without Visio being present. For example, this enables an entire class of server-side scenarios where the server can not only manipulate diagram content, but can also make changes to custom UI in the document.
Developing with Visual Studio 2010
The recommended Visual Studio version to develop for Visio 2010 is Visual Studio 2010, which is currently available as Release Candidate. Visual Studio 2010 offers a friendly design environment with the Ribbon Designer, where developers can easily drag and drop ribbon groups and controls onto a graphical design canvas. Also, a Visio 2010 VSTO template is available for you to easily create a Visio add-in project. Multi-project deployment packages, post-deployment actions, and removing PIA dependencies are all benefits from using VS 2010. For more information on what’s new in VS 2010, see this MSDN article.
With Visio 2010 and the UI extensibility model available, you now have the opportunity to utilize our more intuitive attractive drawing surface to broaden your user base. We highly recommend moving existing solutions to the Fluent UI. It is worth the work to get rid of the old menu bars, and help your users realize the full capability of your solution by making it easier to use. For new and old solution developers alike, Visual Studio 2010 allows a great way to easily develop Fluent UI for Visio 2010 as well.
To get more details about UI extensibility for Office 2010 applications, here are some helpful links:
Microsoft Office 2010 Engineering blog
Microsoft Office 2010 Engineering blog
UI Extensibility in Office 2010- Including details on customizing Office Menu and Backstage View
UI Extensibility in Office 2010- Including details on customizing Office Menu and Backstage View
Office Development in Visual Studio 2010
How to setup the Ribbon Visual Designer
Ribbon best practices
Office Development in Visual Studio 2010
How to setup the Ribbon Visual Designer
Ribbon best practices
Do try implementing your own Visio ribbon and send us feedback through the Send a Smile feedback tool or comment on this post!
A few updates…
We recently reported the availability of Service Pack 2 (SP2) for Visio 2007. We received a few questions about how to use the XMI export feature in UML diagrams. The behavior in SP2 is exactly the same as in previous versions. Integrating it into the UML solution and retiring the separate download should make life easier for everyone, including us! The following VBA example demonstrates the interface:
Application.Addons("UML Background Add-on").Run("/CMD=400 /XMIFILE=""C:\path\file.xmi""")
Application.Addons("UML Background Add-on").Run("/CMD=400 /XMIFILE=""C:\path\file.xmi""")
The XMI export acts on the active document, so be sure to set that if your application session has multiple documents open. If you’re not familiar with VBA, the extra quotation marks in the XMIFILE argument are used to escape the quote character – the value passed in must be wrapped in quotes.
Visio Conference 2008 Videos
Last year, we posted links to videos from the Visio Conference 2008, where we shared a few glimpses into the next version of Visio. The links have changed – replace the visioconference2008 part of the URL with visio2008 to get to the video site. Note that some of the videos are quite large and can take a bit to download.
In this post, we take a break from Visio 2007 information and explore a peculiar shape design issue. If you have worked with Groups in Visio, you have probably encountered a situation where the shapes inside of a group just don't behave properly during resize. Sometimes you want shapes inside a group to resize with the group. Sometimes you don't. Visio provides a setting to control the resize behavior, but you may be surprised how it works. Enter ResizeMode.
ResizeMode is the name of the Shapesheet cell that controls shape resize within groups. This is presented as Resize Behavior in the Format > Behavior dialog. There are three possible settings for the resize behavior: Scale with group, Reposition only and Use group's setting.
A shape inside a group will have one of these three settings. Really there are just two behaviors (scale & reposition), with the third setting just deferring up to the group for its value. The default setting is Use group, which in turn defaults to Scale. So how does Scale and Reposition affect the resizing of shapes inside a group?
Scale allows the shapes inside the group to stretch as the group stretches. Reposition maintains the original size of the shapes but moves their center as the group stretches. Sounds straightforward enough, so what's the catch?
The catch is that ResizeMode only works when used BEFORE a shape is grouped. When a shape is put into a group, Visio uses ResizeMode to determine what formulas get applied to the shape to make it resize with the group. Changing ResizeMode later on has no effect on the resize behavior. Thus it is quite likely that users change the setting and then get frustrated when nothing happens. It's just not a good design.
Here is the Shapesheet view of what is happening. ResizeMode is a cell in the Shape Transform section. The default is 0 (Use group's setting). Reposition only is 1. Scale with group is 2. Below is the Shapesheet for a shape before it is grouped.
Below is the Shapesheet of a shape with ResizeMode = 1 that is then grouped. Notice that the Width and Height formulas are untouched, but the PinX and PinY depend on the group. This is the Reposition behavior.
Below is the Shapesheet of a shape with ResizeMode = 2 that is then grouped. Notice that Width and Height now depend on the group. This is the Scale behavior.
Changing ResizeMode in the Shapesheet and in the Format > Behavior dialog has no effect on these formulas. The setting only comes into play at the time the shape is added to a group. Visio has some work to do to clean up both the design and the documentation for ResizeMode. Hopefully this article explains what is really happening.
Visio has long had the ability to display, import and export CAD drawings stored in the DWG and DXF file formats. If you are unfamiliar with the ways that Visio can work with CAD drawings, please read through this previous post.
In Visio 2003 the CAD feature set was overhauled to improve performance and reliability plus provide a better mapping of Visio shapes to CAD entities on Export. There were changes in the CAD Display Properties and Conversion dialogs as well. Unfortunately there were a number of serious bugs that impacted the functionality of the feature set. A few items have been fixed in Visio 2003 service packs, but many more were addressed in Visio 2007.
This post describes the problems in Visio 2003 that were corrected in Visio 2007. The next post will discuss the remaining issues surrounding Visio's CAD integration.
Insert CAD Drawing
There are two ways to display a CAD drawing in a Visio document. If you go to File > Open, you can point directly at the DWG or DXF file and open it. Visio creates a new blank drawing, chooses a page scale that will fit the CAD drawing to the Visio page and adds the CAD drawing. Another method is to start from an existing diagram and go to Insert > CAD Drawing. Visio shows the CAD Drawing Properties dialog and allows you to specify the scale you want to use. Unfortunately, there are several issues going this route in Visio 2003:
· Visio defaults to a custom scale that fits the CAD object to the page, but this scale does not match the scale of the Visio page. If you choose this default, the CAD object will be scaled incorrectly with respect to everything else in the diagram. When inserting into an existing diagram you should always choose the current page scale. The custom scale default is really only useful when you want to use the CAD drawing as an unscaled image in your diagram.
· Since CAD drawings don't explicitly define what units of measure are used, you must specify the CAD drawing units in the dialog to properly scale the CAD object. This can be confusing, and in Visio 2003 the setting doesn't work. The value is ignored, resulting in improper scaling for CAD objects drawn in Metric coordinates.
· For those who bravely tried to get the scale settings configured properly, there is one more problem: The preview pane did not update as you made changes to the settings. Thus the visual feedback about what you would get was also wrong.
These issues combined to make Insert > CAD Drawing very challenging in Visio 2003. Settings either didn't work or were configured improperly by default. This created unnecessary confusion and frustration for customers. Visio 2007 corrects these problems, although it is still the responsibility of the user to set the CAD drawing units properly to end up with the right scale.
A note of caution for Visio 2007: The CAD Drawing Properties dialog does not remember settings very well. Once you close the dialog and reopen it, you will have to reset the Pre-defined scale to Page Scale again. Also do not manually resize the CAD object using the green shape handles since this just distorts the scale.
Export CAD Drawing
Visio drawings are exported to CAD files using the File > Save As > DWG / DXF command. If there is no existing CAD object in the drawing, Visio converts the Visio shapes to entities correctly. If there is a CAD object in the drawing, Visio 2003 fails to use the proper scale to ensure that the converted Visio shapes match up with the existing CAD object's entities. It also fails to position the converted shapes relative to the existing CAD entities. Additionally any cropping or rotation of the CAD object is ignored in the exported file.
Visio 2007 corrects most of the scaling and positioning issues. There are a few cases with dimensions that still are troublesome. Visio 2007 does not support cropping or CAD object rotation on export.
Many of the fixes in Visio 2007 can be credited to a group of customers that are passionate about Visio and its use with CAD drawings. At the Visio Conference in 2006 the product team showcased the upcoming Visio 2007 version with its emphasis on data connectivity. However, a number of partners and customers voiced concerns about the problems with CAD in Visio 2003. In an ad-hoc meeting, we sat down with all interested parties to understand the issues and hear firsthand how important the feature is for these customers.
Following the conference, the Visio team did an extensive review of the CAD feature set to uncover the bugs that were causing the most customer pain. These issues were corrected in Visio 2007 and released as part of the Visio 2007 betas to have partners and customers verify the fixes. The result is a significantly better experience in Visio 2007 over Visio 2003. We weren't able to address all concerns though. Next time we will look at the current state of CAD integration in Visio.
A recent newsgroup post asks for an explanation of the cells that get added to a shape when it is converted using the Process Engineering add-on.
The Shape Conversion command in Process Engineering allows you to make any shape work like the built-in Process Engineering shapes. We recognized that customers who made Piping & Instrumentation diagrams often had custom equipment or valves or instruments that they needed to include in the diagram. Shape Conversion modifies a custom shape to make it recognizable by the Process Engineering add-on and match the behaviors of built-in shapes.
You can try this by drawing a rectangle and choosing Shape Conversion from the Process Engineering menu. In the dialog, note that the shape Source is already set to Selected Shapes. Process Engineering can also bring in shapes from other documents or CAD symbols. Then comes the challenging part: you can optionally give the shape a Category and Tag Format. Categories are used to organize the shape in the Component Explorer window. You can choose an existing category or type in a new string. Tag formats are used for automatically labeling and numbering shapes. You must choose from an existing tag format. Visio only offers you choices for Categories and Tag Formats that already exist in the drawing, so if you want your shape to be a piece of Equipment you should drop a built-in Equipment shape on the drawing before converting your custom shape.
After clicking OK, you can open the Shapesheet window to see what changes were made to your shape. The primary change is the set of User-defined cells added to the shape. These cells identify the shape and control its behavior in the diagram.
Here is a brief explanation of each cell:
A GUID (unique identifier) that tells Visio what add-on is managing the shape. All shapes that are used with Process Engineering, need the GUID matching the Process Engineering add-on.
The Category that the shape is assigned to. The shape appears under this name in the Component Explorer.
The current tag name (label & number) for the shape.
The Tag Format name and expression for the shape. Unless the Component Tag has been overwritten, this is the automatically generated label displayed on the shape.
The sequence number for the shape. Visio updates this value when components are renumbered. This value then feeds into the Component Tag.
A Boolean value that determines whether the Component Tag is displayed on the shape. This is manipulated by an Action in the Actions section.
A value that references the global page setting for hiding tags. If tags are hidden at the page level, then the local setting is ignored.
This is a bit flag that controls the layout behavior of the components in the diagram. Mostly these settings determine how the split and heal features in Process Engineering work. Here are the bits:
CAUSES SPLIT = 1 (Splits connector when dropped on connector)
CAUSES HEAL = 2 (Heals connector when deleted)
ALLOWS SPLIT = 4 (Connector splits when shape dropped)
ALLOWS HEAL = 8 (Connector heals when shape deleted)
ALLOWS JUNCTION = 16 (Connector to connector connection)
JUNCTION IN USE = 32 (Temporary state)
The default setting here is 31, which enables all the split and heal and junction behaviors.
There are a few other changes to connection points, action cells and text to complete the conversion. These are straightforward changes, and you can inspect the Shapesheet to see the details.
In the previous post we reviewed the problems users were encountering with the CAD Integration feature set in Visio 2003 and the fixes that were made in Visio 2007. In this post we look at the remaining issues with CAD and Visio.
Converting CAD drawings to Visio shapes
Visio 2003 changed the way that CAD drawings are converted to Visio shapes. Instead of converting each entity and adding it as a Visio shape, the entities are converted in bulk to an intermediate document and then the entire document is merged into the current drawing in one big Paste operation. This change makes conversion up to 10 times faster – a significant improvement. However, Visio now requires quite a bit more memory to accomplish the task. On PCs without sufficient memory, performance degrades because Visio must page memory to disk.
Additionally we have found that some really large CAD files fail to convert. There is a limit to the number of entities that can be converted at once, though this limit is not easily expressed as a quantifiable number. Unfortunately the failure comes near the end of the lengthy operation rather than at the beginning. Visio 2007 does not remedy this situation. Your best bet is to divide up the diagram into more layers and then convert the layers individually. While Visio should handle this situation better, keep in mind that CAD programs are designed to deal with hundreds of thousands of simple entities and Visio is designed to deal with thousands of complex entities. It's difficult to scale up to support the largest CAD drawings out there. Simplifying the drawing before bringing it into Visio is recommended.
DWG file formats supported by Visio
A frequent complaint from users is that Visio refuses to open a DWG file because it was saved in a newer format. Visio 2003 and 2007 do not support the latest file formats used in AutoCAD programs. That means CAD files must be saved back to a compatible version before they can be used with Visio. Visio 2003 and 2007 support the R15 version of the DWG format. This was the default format used by AutoCAD 2000 and AutoCAD 2002. Newer versions of AutoCAD save to newer versions of the DWG format by default.
Additionally, Visio does not support all the entities defined in the R15 version of the DWG format. In terms of entity support, Visio handles the entities defined in the R14 version of the DWG format with a few exceptions. A specific entity list is beyond the scope of this blog post. The point is that the level of entity support and the version of the file format supported are not identical.
Note that there was a specific problem where files saved out from AutoCAD 2007 would not open in Visio 2007 even when saved back to the R15 format. This was corrected in Visio 2007 SP1.
What's next for CAD integration
It's too soon to announce our plans for the next release. We continue to gather information from customers about their needs for CAD with Visio. Your input on specific issues or the overall importance of CAD integration to your Visio usage is encouraged.
This is the second topic in a series discussing the essential features that make up the Visio application.
Essential Feature: Drawings, Stencils and Templates
In the previous post on Drag and Drop, we mentioned that Stencils were separate documents from the drawing and thus Visio has to make a local copy of a master shape when you drag one onto the page. So what is the difference between a stencil and a drawing? And what about templates?
Actually, there is very little difference between these three types of Visio documents. That's because there is really only one document type in Visio. Drawings, stencils and templates are the same technically. The difference is in the “view” of the document information presented to the user.
Try this: make a simple flowchart by starting from the Basic Flowchart template. Drag some shapes onto the drawing page from the Basic Flowchart Shapes stencil. Save the drawing as MyDrawing.vsd and exit Visio. Now rename the file, changing the extension from 'VSD' to 'VSS'. Reopen the drawing in Visio. What do you see? You should see a stencil with just the master shapes you dragged into your drawing. Close Visio and change the extension to 'VST'. Now what do you see when the file is reopened? You should see your drawing but with a generic filename like Drawing1.
What's going on? Every Visio document has a drawing surface - the page that you drop shapes on. Every document also has a stencil containing masters, called the Document Stencil. The file extension tells Visio whether to open a document showing the drawing surface or the stencil. You can see the Document Stencil for your drawing by choosing File > Shapes > Show Document Stencil. Templates are just like drawings. The only difference is that Visio will open a template as a copy of the original document by default. This explains the change in filename.
Another part of a Visio document is the workspace information. Whenever you save a drawing, Visio records the names of the stencils that were opened with your drawing. These stencil documents are automatically reopened the next time your file is reopened.
Those of you who are familiar with Visio's file format history know that there are now two sets of Visio file extensions. VSD, VSS and VST are the drawing, stencil and template extensions for Visio's binary document format. There is a companion set of VDX, VSX and VTX extensions for Visio's XML document format. The XML document format is a full fidelity peer of the binary format that was introduced in Visio 2002. The XML formats offer an under the hood view of the contents of a Visio document. They allow developers to write programs that build new drawings from scratch or read the contents of a drawing – all without having to launch the Visio application.
Try saving out a drawing as XML and then opening the file in a text editor. You can rename the file to give it a .XML extension and view it in Internet Explorer too. There is a lot of information, but if you dig around you'll find the Masters collection that makes up the Document Stencil and the Pages collection that makes up the drawing. You may even find the workspace information.
Our MVP community has been quite busy creating new resouces for Visio. We'd like to highlight a few recent releases here.
In response to a newsgroup discussion on Visio's Network Rack shapes. Chris Roth (Visio MVP and former employee) has released a new shape for displaying rack unit dimensions.
Second, the latest version of the Work Breakdown Structure (WBS) Modeler add-in has been released. To quote from the add-in description:
"The Microsoft Office Visio 2007 WBS Modeler is intended to improve the project planning process by giving the opportunity to generate Project Plans from a Work Breakdown Structure (WBS) using a graphical representation of elements.
The Application enables effective integration of Microsoft Office Visio 2007 with Microsoft Office Project 2007. It provides an approach to visually and graphically create, edit and modify project plans using Visio 2007."
Finally, there are new training materials for Visio 2007 solution development. Here is the summary for the download:
"Gain deeper technical skills around Visio 2007 solution development. The Visio 2007 Solution Development Workshop is a free to download, self paced instructional guide covering the concepts and techniques needed to develop Visio based data visualization solutions. The content of this workshop maps to the main themes of the upcoming Visio MCP examination, makes for an excellent readiness resource and provides partners with the skills to start build data Visualization solutions today."
A common newsgroup question is how to prevent the Template Help task pane from appearing every time a document is opened. Not only do we see lots of newsgroup posts about this, it turns out that one of the more common pieces of feedback we receive through Rate this Template is “Let me disable this task pane”.
Here are the steps to disable automatically showing the task pane:
1) Go to Tools > Options in the menu
2) Click on the General tab and choose Service Options at the bottom
3) Select the Online Content category and uncheck “Show Template Help automatically…”
The task pane is intended to help people learn more about various diagram types. Unfortunately the design tends to focus on the initial usage experience (having the template help in your face) at the expense of ongoing productivity (having lots of drawing space). Perhaps the biggest problem is that there is no place on the task pane itself to disable the automatic behavior.
The good news is that there is no Template Help task pane in Visio 2007. There is a link to template help at the bottom of the Getting Started screen. It is grouped with all the other content available from Office Online. Hopefully this is a better location both for those that want to find template help and those that do not want to be bothered by template help.