Visio Insights
The official blog of the Microsoft Visio product team

  • Visio Insights

    Running with Characters

    • 2 Comments

    When working with shape text through automation, the Text property of a Shape is generally sufficient to get and set the text.  However, this simple property ignores the fact that Visio text may have rich formatting applied or that the text is composed of text fields.  If you need a more industrial-strength way to retrieve and modify shape text, use the Characters object for the Shape.

     

    Characters is a kind of do-it-all object for manipulating text.  It is capable of breaking text down into individual characters or sets of characters.  The Characters object can describe text in much the same way that the Visio Shapesheet stores shape text.  Consider the following shape with text:

     

     

    The shape text consists of a single line with a variety of formats applied to the characters.  Visio has to keep track of not just the characters but their formatting as well.  It does this using text runs.  A text run is a set of characters that have something in common.  Typically a text run is a set of characters with identical formatting.  That is how Visio represents text in the Shapesheet.

     

     

    Our sample text is described by six text runs.  The number in the first column defines how many characters are in the run.  Thus “Hello “ is described by the first line.  “World” is in the second line.  The space after “World” is next.  Then “Sample “, then “Text”.  Finally Visio (starting in 2003) terminates text with a non-visible character.  Note that this final character is not reported when using the Shape.Text property, but it is reported using Shape.Characters.Text.  Our sample text varies mostly by the Style property, which defines whether there is any bold, italics or underlining.  Also the Color property varies for one text run. 

     

    There is also a notion of a paragraph run, which is the collection of all characters with the same paragraph formatting properties.  Note that, like a text run, a paragraph run can span across carriage returns because it describes the formatting not the structure.  The number in the first column defines the number of characters in the run.  In our example all the characters in the shape text use the same paragraph formatting properties, so Visio put a zero in the column.  This would similarly apply to the Characters section if there were no variation in character formatting.

     

    The Visio SDK has sample code demonstrating how to set up custom formatting on shape text, but there isn’t an example of reading the text back.  Let’s take a look at a function that can analyze Visio shape text and return the specific text runs that describe the formatting boundaries.

     

    using System;

    using System.Collections.Generic;

    using System.Text;

    using IVisio = Microsoft.Office.Interop.Visio;

     

    public class TextUtilities

    {

        public static List<string> getTextRunList(IVisio.Shape vsoShape)

        {

            List<string> textRunList = new List<string>();

     

            // Get the Characters object representing the shape text

            IVisio.Characters vsoChars = vsoShape.Characters;

            int numChars = vsoChars.CharCount;

            int runBegin = 0, runEnd = 1;

     

            // Find the beginning point and end point of every text run in the shape

            for (int c = 0; c < numChars; c = runEnd)

            {

                // Set the begin and end of the Characters object to the current position

                vsoChars.Begin = c;

                vsoChars.End = c + 1;

     

                // Get the beginning and end of this character run

                runBegin = vsoChars.get_RunBegin((short)IVisio.VisRunTypes.visCharPropRow);

                runEnd = vsoChars.get_RunEnd((short)IVisio.VisRunTypes.visCharPropRow);

     

                // Set the begin and end of the Characters object to this run

                vsoChars.Begin = runBegin;

                vsoChars.End = runEnd;

     

                // Record the text in this run

                textRunList.Add(vsoChars.TextAsString);

     

                // As the for loop proceeds, c is set to the end of the current run

            }

     

            return textRunList;

        }

    }

     

    This C# code uses a .NET 2.0 Generic string list to store each text run found.  The Characters object is retrieved from the text, and the total character count is stored.  Then the procedure iterates through the characters from beginning to end.  However, the For Loop is unusual because it does not increment on a character by character basis.  Let’s examine the For Loop more closely.

     

    The purpose of the For Loop is to find text runs and add them to the string list.  First a substring within Characters is defined by setting the Begin and End properties of Characters.  This substring is initially just the next two characters in the text.  Then the boundary of the text run containing those characters is established by calling RunBegin and RunEnd.  These methods search for the first and last characters of the text run containing the substring.  A new substring is defined by updating the Begin and End properties to match RunBegin and RunEnd.  This substring is added to the text run list.  Since the procedure has located the end of the current run, the For Loop is incremented to start at this position when looking for the next text run.

     

    Once you have a list of the text run strings, you can match them with the property information retrieved from the Characters section of the Shapesheet.  This gives a more complete description of the text contents.  There are other uses for RunBegin and RunEnd beyond character formatting.  By passing other flags to the methods, you can get the paragraph runs instead or even individual words or text fields.

     

  • Visio Insights

    Need help finding commands in the new Visio 2010 ribbon?

    • 9 Comments

    In Visio 2010, we completely revamped the Visio user interface and adopted the Office Fluent UI or the “Ribbon”. With the Office Fluent UI, Visio’s extensive capabilities are organized into logical, easy to find groups that help you accomplish tasks efficiently. The breakdown of each of the core tabs in the Visio 2010 Ribbon was explained in a previous post.

    image

    Although the Office Fluent UI was designed to help make the Office applications easier to work with, we realize that there is a learning curve for the new Office Fluent UI.

    Did you know that there are tools available to help you learn the new Visio 2010 Ribbon?

    Office 2010 menu to ribbon reference workbooks

    Looking for a list of the 2007 menu and toolbar commands and their new 2010 locations? You’re in luck! Each Office application has an Excel workbook that lists the old menu commands and their new locations in the Office Fluent UI. You can find these workbooks here.

    image

    Interactive guides to find commands

    Would you prefer an interactive program that shows you the new location of a command? Interactive guides for each Office application can be found here. Just click the Visio 2007 command or button that you want to find and the guide will show you its location in Visio 2010. These guides are available as online tools or can be installed on your own computer for use any time (even when you’re not connected to the Internet).

    image

    We are enjoying the new look and feel of Visio 2010, and hope you feel the same way! If you have questions or comments about the Visio 2010 Ribbon, please comment on our blog and let us know.

  • Visio Insights

    Visio 2010 XML Schema Definition Released

    • 6 Comments

    Visio has published the XML Schema Definition (XSD) files for the Microsoft Visio 2010 XML Drawing (.vdx) format. This schema is also known as DatadiagramML. The .XSD files allow developers to better understand the structure of Visio XML documents and design solutions that work with the .VDX file format.

    The DatadiagramML Schema for Visio 2010 consists of three .XSD files:

    • visio.xsd is the core schema used by Visio 2003 and later
    • visio12.xsd is the set of extensions used by Visio 2007 and later
    • visio14.xsd is the set of extensions used by Visio 2010

    More information about the schema is available in the Visio 2010 XML Schema Reference on MSDN.

    Do you work directly with Visio XML files?  We’d love to hear about your scenarios in the comments.

  • Visio Insights

    New resources for Visio

    • 5 Comments

    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.

     

    http://www.visguy.com/2007/04/01/rack-unit-dimension-line/

     

     

    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."

     

    http://www.microsoft.com/downloads/details.aspx?FamilyID=34c28a49-e14c-4a7d-8d49-90061fe08ab4&DisplayLang=en

     

     

    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."

     

    http://www.microsoft.com/downloads/details.aspx?FamilyID=332c211e-581e-4029-9839-8f45de10b4c2&DisplayLang=en

     

  • Visio Insights

    Text Control Handles

    • 3 Comments

    Shape control handles offer users convenient ways to take advantage of the intelligence built into the shape by a designer.  Perhaps the most common use for a control handle is to link it to the text on a shape.  While Visio provides the Text Block Tool for manipulating shape text, this tool is not very discoverable (it’s underneath the Text tool in the Standard toolbar) and is cumbersome.  A control handle is a very convenient alternative.  In fact, Visio 2003 has a text control handle built into the default dynamic connector.

     

     

    The dynamic connector incorporates a couple of behaviors that you may find helpful in the design of your own shapes:

    ·         The control handle is not shown unless there is actual text in the shape

    ·         The user can use either the control handle or the text block to reposition the text

    Let’s look at the Shapesheet for a dynamic connector to see how these behaviors are implemented.

     

    The visibility of the control handle is determined by the X Behavior cell.  This cell describes how the control handle should resize with the shape, whether it can be moved at all and whether the control handle is visible.  An IF statement sets the behavior to 5 to hide the handle or 0 to show it.  The conditional statement verifies that the shape has no text or that it is currently not visible.  Note the use of the STRSAME function to check for text.  This is the recommended practice.

     

    SETATREF

    The synchronization of the control handle and text block is accomplished using the SETATREF function.  This is a very powerful and complicated function that needs some introduction.  We’ll look at the basic capability as it is used in the text control handle here, but there is quite a bit more to cover in a future post.

    Consider a typical formula dependency where cell A depends on cell B.  As long as the user modifies cell B, then A and B will both be up to date.  What happens if the user modifies cell A?  This change would blast the formula in cell A, decoupling it from cell B.  You could GUARD the formula in cell A to preserve the dependency on cell B, but now the user cannot manipulate cell A at all.  SETATREF solves this problem by preserving dependencies and forwarding inputs to the independent cell.  SETATREF allows cell A to depend on cell B while also allowing the user to change either A or B.

    In the case of the text control handle, the position of the text block is dependent on the position of the control handle.  Thus the TxtPinX and TxtPinY cells have formulas with references to Controls.TextPosition and Controls.TextPosition.Y respectively.  These references are then wrapped by a SETATREF formula.  To understand how SETATREF works, we need to separate what happens during recalculation versus what happens during cell input.

    Because TxtPinX and TxtPinY have formulas with references to the control handle position, these cells must be recalculated whenever the control handle position changes.  During the recalc operation, the SETATREF function is transparent.  SETATREF(x) = x.  In other words, the result of the recalc is just like if there were no SETATREF wrapped around the cell references.  On the other hand, when the user directly manipulates the TxtPinX or TxtPinY cells (by using the Text Block Tool), SETATREF influences how the new value updates the Shapesheet.  Rather than letting the new cell value replace the SETATREF formula, Visio forwards the value to the cell referenced in the SETATREF function.  Thus any change to the TxtPinX or TxtPinY cell is actually made to the Controls.TextPosition or Control.TextPosition.Y cell instead.  Then the TxtPinX and TxtPinY cells pick up the change through recalculation.

    This ability to preserve dependencies and forward input values is extremely versatile for shape development.  We’ll look at some more sophisticated uses for SETATREF in a future post.

     

  • Visio Insights

    The Point Along Path ShapeSheet Functions in Visio 2010

    • 4 Comments

    In a previous blog post about new ShapeSheet functions, we introduced a set of new functions called the Point Along Path functions. These functions allow interactions with geometry paths of shapes. This post provides more detail about these new functions.

    The following functions open up a broad set of shape interactions for shape and solution developers:

    Function/Syntax

    Description

    ANGLEALONGPATH(section,travel [,segment]) Returns the angle of the tangent to the path at a given point.
    DISTTOPATH(section,x,y) Returns the shortest distance from the point represented by the specified coordinates to a point on the path.
    NEARESTPOINTONPATH(section,x,y) Returns the percentage of the distance along the path of the point that is nearest to the specified coordinates, as a value between 0 and 1.
    PATHLENGTH(section[,segment]) Returns the length of the path that is defined in the specified Geometry section.
    PATHSEGMENT(section,travel) Returns the 1-based segment number at the specified percentage mark along the specified path.
    POINTALONGPATH(section,travel[,offset][,segment]) Returns the coordinates of a point on, or offset from, the path.
    SEGMENTCOUNT(pathRef) Returns the number of line segments that make up the path.

    In the above functions:

    • Arguments in brackets [ ] are optional
    • Section always refers to a Geometry path. The correct way to reference a geometry path section is to enter the section reference followed by “.Path” (for example, Sheet.1!Geometry2.Path)
    • Travel is a measure of the position along the path between the beginning and the end points, defined as a percentage. It is always represented by a number between 0 and 1, where 0 represents the beginning point, and 1 represents the end point
    • Segment is a 1-based index of a line segment in the path that corresponds to a row in the geometry section.

    To give you an idea of what you can do with these functions, we'll explore three examples.

    Adorning a Connector

    We've seen shape developers create connector adornments to convey additional information. With the Point Along Path functions, this is now easier than ever to do.

    Here's a simple triangle shape that sits at the midpoint of the connector, and changes direction with the connector. It works with curved and right angle connectors:

    triangle

    To create this adornment, you only need a few ShapeSheet formulas:

    • First, make sure that the adornment shape will be ignored by the Visio routing engine. To do this, select the shape, and click "Behavior" from the Developer tab. In the ensuing dialog, click on the "Placement" tab, and ensure that placement behavior is set to "Do not lay out and route around".
    • Create a user cell in the adornment shape (we'll call it User.ConnectorGluePoint, and use the POINTALONGPATH() function and reference the connector that the shape will adorn:
      • POINTALONGPATH(Dynamic connector.23!Geometry1.Path,0.5)
      • This returns a point in local coordinates to the connector
    • Create another user cell, User.PageCoord, and use the LOCTOPAR() function to translate the local coordinates to page coordinates:
      • LOCTOPAR(User.ConnectorGluePoint,Dynamic connector.23!User.msvThemeColors,User.msvThemeColors)
      • The LOCTOPAR function needs cell references for the source and destination of the translation. Here we arbitrarily use User.msvThemeColors because the property exists in both the source and destination.
    • Now, set PinX,PinY, and Angle cells on the adornment shape accordingly (found in the Shape Transform section):
      • PinX: GUARD(PNTX(User.PageCoord))
      • PinY: GUARD(PNTY(User.PageCoord))
      • Angle: ANGLEALONGPATH(Dynamic connector.23!Geometry1.Path,0.5)-PI()/2
        • We subtract PI/2 because we’re using a triangle and the point is not aligned with the 0 angle. The ANGLEALONGPATH() function returns the tangent angle to the specified point on the path.

    Finding the Nearest Point on a Path

    You can use the NEARESTPOINTONPATH() function to find the coordinates of a point along a path that is closest to a given point. In the picture below, the triangle shape is showing the nearest point along the path to the center of the circular shape:

    nearest point

    Here’s how we setup the triangle to do this:

    • Create a user cell in the triangle shape to store the point of the circle shape (we’ll call it User.LocalPoint) Use the following formula to transform the LocPin point of the circle into local coordinates relative to the curve:
      • LOCTOLOC(PNT(Circle!LocPinX,Circle!LocPinY),Circle!Height,ArcLine!Height)
      • We use the PNT function to turn the LocPinX and LocPinY into a point
    • Create another user cell in the triangle (we’ll call it User.Travel) to store the percentage along the path (the travel) that is nearest to the circle. Use the following formula:
      • NEARESTPOINTONPATH(ArcLine!Geometry1.Path,PNTX(User.LocalPoint),PNTY(User.LocalPoint))
      • This returns the percentage along ArcLine!Geometry1.Path that has the nearest point to the center of the circle shape
    • Create another user cell (we’ll call it User.ArcGluePoint) to store the point along the path of the arc that is closest to the circle. Use the following formula:
      • POINTALONGPATH(Sheet.1!Geometry1.Path,User.Travel)
      • This will return the point on the arc where the triangle should be glued, in local coordinates relative to the arc.

    Just like the example above, you then need to transform the local coordinates, and set the PinX and PinY of the triangle so that its glued to the arc.

    Curved Timelines

    The above two examples illustrate how you can use the Point Along Path functions. As an application of the same concepts above, we built a curved timeline:
    curvy timeline

    As you change the curve of the timeline, the milestone shapes stay attached to the curve, which allows you to create a great looking visual.

    The main difference between this example and the previous one is that we’ve introduced a mechanism for automatically attaching adornments to the arc geometry. Here we turned the arc shape into a custom container to give the milestone shapes a universal reference. Since they are members of the container, we use the CONTAINERSHEETREF() function to reference the geometry of the arc. When you make multiple copies of the milestone shape, their reference to the timeline arc geometry is preserved as long as they are members of the container. (For more info on custom containers, see our previous post ).

    To place the milestones accurately on the timeline arc, we used the POINTALONGPATH() function. Each timeline shape stores its own date. The timeline arc contains the “begin” and “end” dates of the timeline.

    The attached VSD file includes the curved timeline, and the other two examples, so you can take a look at the formulas and play around with them.

    We think these new functions will open up a new set of scenarios for shape developers. Some things you might try to create with them are:

    • Placing text or adornments at fixed distances from the beginning or end of a connector
    • Detecting whether a point is inside or outside a closed path
    • Calculating the lengths of curved paths in a diagram
    • Drawing a line that terminates on a complex path

    As usual, please tell us what you think by using the Send a Smile feedback tool or by commenting on this post.

  • Visio Insights

    March Madness: Fill Out Your Brackets With Visio

    • 1 Comments

    March Madness is about to start, so here’s a Visio diagram to let you quickly fill out and share your bracket! Download the diagram here, and with a few clicks you can have a complete professional looking bracket that you can easily share with others. This diagram was originally created by Visio MVP Chris Roth, who runs the Visio Guy blog.

    image

    The bracket has the first 64 teams already filled out. All you need to do is select the winners. You can fill out the bracket using Visio in one of the following ways:

    • Right click a bracket shape to select a winner:

    image

    • Entering the final score of a game by double clicking a bracket shape to open the shape data window (entering scores is optional)

    image

    When you enter the score in the shape data window, the shapes will update and propagate the winner to the next level in the bracket.

    Note: the 8 teams playing in the first round are playing on 3/15 and 3/16, so you’ll need to update the bracket once those teams are decided. In the bracket, those teams are highlighted with a red asterisk so you don’t forget.

    Chris Roth’s original diagram can be found on his blog here: http://www.visguy.com/2009/03/16/ncaa-final-four-interactive-visio-tournament-bracket/ He originally created this diagram during the 2009 tournament, and we updated it with the 2011 teams.

    Hope you enjoy this year’s tournament, and good luck filling out your brackets. As always, let us know if you have any feedback or suggestions.

  • Visio Insights

    No More Template Help

    • 8 Comments

    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.

     

     

     

  • Visio Insights

    Visio Mailbag

    • 4 Comments

    We on the Visio product team receive lots of interesting questions from Visio users through our blog’s contact form. In this post, we’ll share our answers to several questions that we thought would be of interest to our blog readers.

    Q: I installed Visio 2010, but the BPMN shapes appear to be missing. Where can I find them?

    A: The BPMN shapes are part of Visio Premium 2010. You can check what edition you have by going to File > Help and looking in the top right.

    Here is a link to the feature set for each Visio edition:

    http://blogs.msdn.com/b/visio/archive/2010/04/09/visio-2010-editions.aspx

     

    Q: If I add hyperlinks to my Visio drawing, will they still work after using Visio Web Access to display them on a SharePoint page?

    A: Yes, hyperlinks will work in the Visio Web Part. Here are some more details:

    • You can hyperlink to web URLs as well as other Visio pages in the document.
    • If you have multiple hyperlinks on a shape, clicking on the shape will open the topmost link or the “Default” link.
    • Pressing Ctrl and clicking on a shape will open the Shape Data pane and select the shape. This will show you all the hyperlinks, and you can click each one.

     

    Q: I upgraded to Visio 2010 and am having difficulty finding the Shape Operations (Union, Combine, Fragment, Intersect, Subtract, Join, Trim, and Offset). Where are they?

    A: In Visio 2010, Shape Operations have been moved to the Developer tab of the Ribbon, which you can enable by turning on Developer mode in Visio Options:

    clip_image001

    Once this is done, click on “Operations” in the Developer Tab to get the menu of operations:

    clip_image002

     

    Q: I am creating a Visio 2010 Cross-Functional Flowchart. How can I select an individual band to specify its color fill?

    A: The easiest way to select a band (also called swimlane) is to click on its text heading, so that you see a dotted outline around the swimlane. You can then choose a fill color, and that will apply to the heading portion of the band, as follows:

    clip_image003

    To apply the fill to the body of the swimlane, go to the Cross-Functional Flowchart tab in the Ribbon and select a style in the Style gallery that has a fill:

    clip_image004

    This lets you color the whole swimlane as follows:

    clip_image005

    Q: Where can I get support for Visio or report a problem?

    A: The central support place for Visio is the Visio Solution Center.  It allows you to get product information, get self-support or community support, or contact a support representative.

    If you simply want to report a problem, you can choose one of the community support options such as the forums or our contact form. If you want help finding a resolution, you should choose the forums or contact a support representative.

  • Visio Insights

    Make Your Own Bubble Chart, part 3

    • 0 Comments

    This post is part of a series examining Bubble Chart diagrams.  We are building a Bubble Chart stencil from scratch to make diagram creation easy for the user.  You can get the completed stencil from the first post in the series.  In the previous post, we completed the Bubble Chart master shape.  This shape is the background for the chart.  In this post we will build the Bubble Data master shape.  Bubble Data shapes are placed on top of the chart to display information.

     

    Bubble chart 

     

    The Bubble Data shape will hold the data provided by the data source (via Visio 2007's Data Link feature).  The data will define the X and Y position for the shape.  It will also define the Size of the shape.  We will use a circle as the basic geometry for the shape and set the diameter of the circle according to the Size property.  The shape will also display a Label and the Size as text using Visio 2007's Data Graphics feature.

     

    The final location for a Bubble Data shape is dependent on its own data plus information about the size and position of the Bubble Chart shape on the page.  Without resorting to code, the Bubble Data shape does not have an explicit reference to the Bubble Chart shape.  We are using the page itself as an intermediary.  The Bubble Chart shape pushes its settings to the page, and the Bubble Data shape will reference those settings.  We need to add the same User-defined cells from the Bubble Chart's Pagesheet to the Pagesheet of the Bubble Data shape.  There is a quick way to copy this information over.  Double-click on the Bubble Chart master shape to edit it.  Select the rectangle shape and copy it to the clipboard.  Close the edit window and double-click on the Bubble Data shape.  Paste the rectangle shape and then delete it.  What did this accomplish?  Go to Window > Show Shapesheet to look at the Pagesheet for the Bubble Data master.  All the User-defined cells were copied over from the Bubble Chart master.

     

     

     

    Next draw a circle on the page and go to Window > Show Shapesheet.  The circle shape will use Shape Data to store the linked data and User-defined cells to calculate the actual position on the page.  Go to Insert > Section, check Shape Data and User-defined cells, then click OK.  We need four Shape Data properties, so right-click in the Shape Data row and choose Insert > Row three times.  Create named rows for BubbleX, BubbleY, BubbleSize and BubbleLabel.  The row names will be referenced in the position calculations.  The Label cell in each row must match the field name used in the data source.  In our example, we are standardizing on the field names X, Y, Size and Label.  If you want to use different names in the data source, change the Label strings here.  Set Type = 2 for the first three rows to identify the Shape Data as numeric.  The final row is left as 0 for a string type.  Then enter some initial values to see the bubble work while you build it.  The values will be overwritten by real data in the diagram.

     

     

     

    Three User-defined cells are needed to calculate the page coordinates for the X, Y and Size properties.  Right-click in the User-defined row and choose Insert > Row twice.  Create named rows for BubbleXPage, BubbleYPage and BubbleSizePage.  The formulas for these cells are lengthy, so they are listed here:

     

    BubbleXPage =

    ThePage!User.ChartMinXPage+(ThePage!User.ChartMaxXPage-ThePage!User.ChartMinXPage)*(Prop.BubbleX-ThePage!User.ChartMinX)/(ThePage!User.ChartMaxX-ThePage!User.ChartMinX)

     

    BubbleYPage =

    ThePage!User.ChartMinYPage+(ThePage!User.ChartMaxYPage-ThePage!User.ChartMinYPage)*(Prop.BubbleY-ThePage!User.ChartMinY)/(ThePage!User.ChartMaxY-ThePage!User.ChartMinY)

     

    BubbleSizePage =

    (Prop.BubbleSize/ThePage!User.ChartSizeFactor)*1 in

     

     

     

    What's going on?  We are using a ratio to calculate the position of the bubble shape.  Given the ratio of the data value between the chart min and max, we can apply the same ratio to the page coordinates of the chart min and max.  The result is the page coordinates for the shape.   A simpler ratio is used to calculate the size of the bubble in page units.  Once we know the coordinates, we can reference them from the Shape Transform section as shown below.

     

     

     

    This completes the functional part of the Bubble Data shape.  Next we turn to the data displayed using Data Graphics.  Right-click on the shape on the page and go to Data > Edit Data Graphic.  Click on New Item and choose Text.

     

     

     

    In the New Text dialog, choose Label from the field list.  Then choose the Heading 2 callout.  Set the Border Type to None to display just the text.  Click OK to close the dialog.

     

     

     

    We want the Label field to appear below the bubble shape.  In the New Data Graphic dialog set the default position to Center, Below Shape.  Now add a second text callout using New Item > Text.  Choose Size for the field and Circle callout for the callout.  Set the border and fill to None.  Also set the Value Length to 0.  This eliminates truncation of the displayed values.  Finally we want this field to be displayed in the middle of the bubble shape.  Uncheck the Use default position box and set the callout position to Center, Middle.  Click OK to close the dialog.

     

     

     

    This completes the data graphic for our Bubble Data shape.  Click OK to close the dialog.

     

     

     

    As a final touch, apply a fill color to the circle to make it work with the Theme feature in Visio 2007.

     

     

     

    Our Bubble Chart and Bubble Data shapes are now finished.  All that remains is to create a data source with real data in it.  Excel is a great choice.  Place the Label, X, Y and Size heading at the top and fill in the data.  You can add other columns as well.  These will be linked as Shape Data and can be displayed if you further customize the data graphic on the Bubble Data shape.  Refer to the first post in the series for a walkthrough from the user's perspective.

     

    Hopefully you've gotten a good insight into the data connectivity and visualization features in Visio 2007.  We combined these features with some intelligent shape design to create a new diagram type for Visio.  We can automatically build a diagram from data, and we didn't have to write any code to do it.

     

  • Visio Insights

    Make Your Own Bubble Chart, part 2

    • 1 Comments

    This post is part of a series examining Bubble Chart diagrams.  We are building a Bubble Chart stencil from scratch to make diagram creation easy for the user.  You can get the completed stencil from the first post in the series.  In the previous post, we started working on the Bubble Chart master shape.  It captures configuration information from the user when the shape is dropped on the page.  The information along with the chart shape's boundaries are stored in properties on the page.  Now we will complete the shape by adding the chart labels.

     

     

     

    Double-click on the Bubble Chart shape in the stencil to edit it again.  There are seven labels on the chart: the title, two axis labels and four axis range boundaries.  Visio only allows one text block per shape, so we need seven shapes to display all the text.  Our rectangle will hold the text for the title.  The remaining shapes will be added as separate text boxes.  Select the rectangle and type some default text such as "Bubble Chart".  The text is centered horizontally and vertically by default.  We want the text to appear above the shape.

     

    Shape text is positioned according to the Text Transform section of the Shapesheet.  Go to Window > Show Shapesheet to open the Shapesheet window.  Then go to Insert > Section, choose Text Transform and click OK.  We need to change the properties associated with the Y coordinate of the text block.  To put the text at the top of the chart, set the TxtPinY cell equal to the shape height.  To make multi-line text grow away from the shape, set the TxtLocPinY cell to zero (note the way this is represented in the picture).  Finally, to keep the text box sized according to its text contents, set the TxtHeight cell equal to the height of the text.  Enter the formulas as shown in the picture below.

     

     

     

    The default text size can be set in the Shapesheet as well.  Find the Character section and set the Size cell to 24 pt.

     

     

     

    Next we need to add more shapes for the other labels.  The rectangle will be a group shape and the other shapes added as sub-shapes.  First, we need to lock the rectangle so that it does not change shapes are added.  Find the Protection section and set LockCalcWH to 1.  When shapes are added to a group, Visio will recalculate the boundaries of the group to encompass the new shapes.  We want our rectangle to define the group boundary and place the labels outside.  LockCalcWH prevents Visio from redefining the group boundary.  Also lock the rectangle from rotation since our formulas assume no rotation.

     

     

     

    Now we can make the group.  Close the Shapesheet window.  Then choose Shape > Grouping > Convert to Group.  Go to Insert > Text Box and draw a text box on the page.  Visio will enter text edit mode and display a flashing caret.  Go to Insert > Field and click on the Custom Formula category.  Enter a formula referencing the minimum X value of the chart.  Sheet.5 is the reference for the rectangle shape.  Prop.ChartMinX is the reference for the Shape Data value.  Press OK to close the dialog and click away from the shape to exit text edit mode.

     

     

     

    Select the rectangle and then Shift+click the text box to select it as well.  Go to Shape > Grouping > Add to Group.  The order of selection is important.  Now the text box is part of the group.  Sub-select the text box and go to Window > Show Shapesheet.  We need to lock the text box into the correct position around the rectangle.  Also the text box should grow to fit its contents.  Fill in the Shape Transform section as shown in the picture below.  Note the change to the LocPinX and LocPinY to make the text box grow down and to the right.

     

     

     

    We need to repeat this process five more times to add the remaining text labels.  Here are the remaining field formulas and Shape Transform sections:

     

    ChartMinY

    Field formula = Sheet.5!Prop.ChartMinY

     

     

     

    ChartMaxX

    Field formula = Sheet.5!Prop.ChartMaxX

     

     

     

    ChartMaxY

    Field formula = Sheet.5!Prop.ChartMaxY

     

     

     

    ChartXAxisLabel

    Field formula = Sheet.5!Prop.ChartXAxisLabel

     

     

     

    ChartYAxisLabel

    Field formula = Sheet.5!Prop.ChartYAxisLabel

     

     

     

    As a final touch, apply a fill color to the rectangle to make it work with the Theme feature in Visio 2007.  Choose a very light color such as 5% Gray or 35% Tint on an Accent Color.  The Bubble Chart shape needs to contrast with the Bubble Data shapes we will place on top. 

     

     

     

    This completes the Bubble Chart shape.  We will build the Bubble Data shape in the next post.

     

  • Visio Insights

    Details on Container Behaviors

    • 0 Comments

    In our previous post we introduced the Containers feature in Visio 2010 and demonstrated some of their basic capabilities.  In this post we’ll look at some additional behaviors of containers. 

    Display Order

    Typically in Visio the most recently added shape is shown on top of the other shapes on the page.  To change this display order you can use commands such as Send Backward or Bring Forward, which are found in the Arrange group on the Home tab.  Containers are intended to sit behind other shapes in the drawing, so we added a new feature in Visio 2010 where we could designate a shape to automatically go behind other shapes when dropped.  Thus you never have to move a container to the back, even if it was the last shape added.

    image

    Selecting Shapes In Containers

    In the previous post we mentioned that containers allow full access to the shapes inside because the container does not form a group.  You can directly click on a shape in a container to select it.  However, whenever shapes overlap, selection works differently; and it can be more challenging to select the exact shapes you want.  We often observe users that select multiple shapes by dragging their cursor to create a selection rectangle.  This is not possible when working on top of other shapes because the drag action will select the underlying shape and start moving it.  Additionally, clicking a shape that is already selected will normally deselect it, but clicking a selected shape that overlaps another will deselect the shape and also select the shape underneath.

    To make sure that containers do not interfere with the natural selection actions of users, we gave them a special ability.  We made the interior of the container act like it had no fill for the purposes of selection.  You can see this behavior in the Technical Preview by trying this: starting with no selection, place the cursor in one corner of the interior of the container and drag a selection rectangle around several shapes inside the container.  You will find that the container is not selected and dragged as would normally occur with a filled shape.

    image 

    We added one more touch to aid with shape selection in a container.  There is a command in the Container Tools contextual tab and on the shape context menu to select all the container’s contents at once.  You can access the Select Contents command when the container is selected or when a member of the container is selected.

    image

    Disband Container

    Shapes placed into a container become members of the container.  When the container is moved, copied or deleted the member shapes are also moved, copied or deleted.  Since deleting a container deletes the members of the container too, what do you do if you only want to get rid of the container?  You could drag all the shapes out first, but this is a lot of work to move them back afterwards.  Thus we added a Disband Container command to the Container Tools contextual tab and shape context menu.  This command deletes the container without deleting the contents.

    Boundary Shapes

    So far we have always shown the member of a container inside the container boundary.  It is also possible to put shapes directly on the container boundary.  The shapes are still considered members of the container, but they behave differently during resize actions.  To put a shape on the boundary of a container, simply drag it there.  Notice the difference in highlighting feedback between dragging a shape into a container versus onto the boundary.  Boundary highlighting appears along a single edge of the container.

    image

    Once a shape is on the container boundary it will move with that boundary.  You can resize the container and the shape will stay on the boundary.

    There’s even more that containers can do once you get into custom shape development.  We’ll save that for a future post.  Next we will look at a special application of the Containers feature.  And don’t forget to send us your feedback through the Send a Smile feedback tool or by commenting on this post.

  • Visio Insights

    Service Pack 2 available for Visio 2007

    • 4 Comments

    Yesterday, we released Service Pack 2 (SP2) for Visio 2007. You can download and install it from:

    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=78e36742-8bda-471e-88e6-9b561bb06258

    Among the issues we've addressed in SP2 are these:

    • A crash caused by early versions of the Broadcom “Send To Bluetooth” add-in occurs every time Visio is shut down. The first crash on exit will still occur, but subsequent crashes will not. The add-in will be disabled until it is updated to a newer version from Broadcom. More information on this and similar add-in issues is available here: http://support.microsoft.com/kb/937997
    • When the Reports feature is used to export a report to Microsoft Office Excel, Excel opens without any user interface except the worksheet window. The ribbon does not appear.
    • Script errors occur when Internet Explorer 8 is used to browse Web pages that are saved from Visio.
    • When a Visio drawing is inserted as a linked object in PowerPoint, Word, or Excel, and the link is updated, the quality of the image degrades.
    • If a Visio file name contains the -r- or -s- characters (for example, “filename -r-”), it triggers a repair of the application when the file is opened in Visio.
    • When a shape is dragged between two instances of Visio, the open regions of the shape are opaque, and this makes it difficult to position the shape on the new page.
    • Appointments in a Microsoft Office Outlook calendar do not import into Visio when the language version of Visio and the Windows locale setting are different.
    • Visio crashes when the 117th layer is added to the page.
    • In a UML Model Diagram, changing the Flow Kind of a Message Object does not correctly reset the Operation field in the UML Message Properties dialog box.

    In addition, SP2 provides these new capabilities:

    • The ability to programmatically export an XML file compliant with the XMI standard from a UML diagram. This functionality was formerly available only as a separate download for Visio 2003.
    • The ability to disable access to CAD (*.dwg) files in Visio 2007. More information is available in this article: http://support.microsoft.com/kb/938803/
  • Visio Insights

    Creating custom validation rules for Visio 2010

    • 1 Comments

    In our last post, we discussed Diagram Validation—a new Visio 2010 feature which allows users to check their diagrams for common errors and allows companies to ensure that employees are following certain diagramming standards. In this post, we’ll talk more about how validation rules are stored and how to create custom validation rules.

    With Visio 2010, we provide diagram validation support for Basic Flowchart, Cross Functional Flowchart, Microsoft SharePoint Workflow and Business Process Modeling Notation diagrams. We also provide an extensive validation API for creating custom validation rules. The supported functionality includes adding and deleting rules and rule sets, directly manipulating validation issues, triggering validation, and detecting the validation event. This support allows companies to develop custom validation rules to meet their own needs.

    At a high level, validation rules belong to rule sets, such as the Flowchart and BPMN rule sets. To see which rule sets are available in your current diagram, click the Check Diagram pull-down menu on the Process tab, and then click Rules to Check. Rule sets with a checkmark beside them are active—rules from these sets will be evaluated during validation. Clicking on a rule set will toggle it between active and inactive.

    RulestoCheck

    There are two main approaches to creating custom validation rules and rule sets.

    1. You can write validation rules and validation logic that will be stored in a custom Visio template. These rules are automatically available to users that create diagrams based on this template. When a user clicks Check Diagram on the Process tab, Visio uses the validation logic provided to determine whether the diagram has issues. In Visio 2010, this technique is used for the Basic Flowchart, Cross Functional Flowchart and Business Process Modeling Notation templates.

    2. You can also write validation logic in code and deploy this logic as part of a Visio solution. For this approach, the solution code listens for the appropriate RuleSetValidated event and uses its own logic to determine the list of issues to add to the document. In Visio 2010, this technique is used for the Microsoft SharePoint Workflow template.

    In both cases, the validation rules and corresponding rule sets are stored inside your Visio file. To see how these rules are stored, you can save a Visio file with validation rules as an XML Drawing (*.vdx) and open the XML Drawing in an XML editor. A search using the keyword “validation” will lead you to the XML related to validation. In the image below, a section of the XML for the Flowchart rule set is shown.

    ValidationXML

    Notice that each rule in the Flowchart rule set contains a RuleFilter and RuleTest property. These properties define the logic that Visio uses to determine whether a rule applies to a particular Visio object, and whether the rule is satisfied by the object. The syntax for each logic expression is the same as a ShapeSheet expression, but the allowable functions differ slightly. You can see many examples of valid RuleFilter and RuleTest expressions in our Flowchart and BPMN rule sets.

    If you save a Microsoft SharePoint Workflow diagram as an XML Drawing (*.vdx) and open the XML Drawing in an XML editor, you will see that there is no logic in the RuleFilter and RuleTest expressions. In this case, the solution contains code with the validation logic. The SharePoint Workflow solution listens for the SharePoint Workflow RuleSetValidated event, and, when this event occurs, it scans the diagram to determine if there are issues. When an issue is found, it uses the validation API to add the issue to the document. Visio automatically displays these issues in the Issues Window.

    ValidationXML-2

    Although you can modify the validation properties directly in the XML, we suggest that developers use the validation API to manipulate rules programmatically. You can use Visual Basic for Applications, accessible through the Developer tab, and its Object Browser to view the validation API. The key objects, methods and properties for validation are shown below.

    ValidationAPI

    There is a lot more that can be said about creating custom validation rules, but hopefully this post gives you a good sense of the options available for using Diagram Validation. The following list summarizes these options.

    1. End-users and companies can use the default rules provide in Visio 2010 to check their diagrams for issues and ensure diagram consistency. Out-of-the box support is included for Basic Flowchart, Cross Functional Flowchart, Microsoft SharePoint Workflow and Business Process Modeling Notation diagrams.

    2. Developers can extend the out-of-box support by creating custom templates with validation rules. These rules are available to users who create diagrams from these templates.

    3. Developers can create Visio solutions that listen for the validation event. When the Check Diagram button is clicked, the solution can run code to validate complex logic and use the validation API to add issues to the list of issues displayed in the Issues Window.

    4. Developers can create Visio solutions that trigger validation from within their code. This allows solutions to make use of validation without relying on a click of the Check Diagram button. For example, the Microsoft SharePoint Workflow template triggers validation when a user clicks the SharePoint Workflow button Export on the Process tab.

    We’re interested to hear your feedback, so use the Send a Smile feedback tool or comment on this post to let us know what you think.

  • Visio Insights

    Roundup of Visio Services Documentation

    • 1 Comments

    Over the past few weeks Microsoft has released a ton of resources to help administrators and end-users get started with Visio Services. This article summarizes all the online resources for Visio Services in one place.

    Visio Services is a new feature in SharePoint 2010 that allows you to view and share dynamic, data driven diagrams. For a quick refresher on Visio Services, see this blog post.

    Administrator Videos

    To help administrators setup and configure Visio Services, we’ve put up a set of instructional videos that will guide you through various setup and configuration tasks. The videos cover basic setup, as well as how to configure Visio Services to connect to external data sources.

    The second and third videos below also show you how to create a data connected diagram in Visio 2010.

    Note: these videos are .WMV files, so you can click them to stream them, or right click and choose to save them locally.

    1

    2

    3 

    Visio 2010 Add-In For SCOM

    In a previous blog post we talked about the Visio 2010 add-in for System Center Operations Manager 2007 R2 . For step by step instructions on how to set this up, check out this new article on TechNet:

    Monitoring SharePoint Server by using Visio Services and System Center Operations Manager

    Other Documentation

    There is tons of documentation available to help you with anything related to Visio Services. Here’s a roundup of it all:

    Visio Services Setup, Configuration, and Planning:

    Visio Services Development

    Using External Data with Visio Services

    Visio Insights Blog posts

    As always, let us know if you have any feedback on Visio 2010, Visio Services, or suggestions for blog posts you would like to see.

  • Visio Insights

    CAD Integration Announcement for Visio &quot;vNext&quot;

    • 7 Comments

    This morning at Day 2 of Visio Conference 2008, we announced that the next version of Visio will add support for AutoCAD 2007 DWG and DXF file formats.  As mentioned in previous blog posts, this was a major request from Visio customers and partners.

    General Manager Richard Wolf explained in his keynote address how Visio prioritizes feature investments that improve the entire Visio platform over changes that enhance just a single vertical market.  CAD integration is valuable to a broad set of customers spanning the Engineering, Facilities Management and Information Technology markets.  Richard then demonstrated an example of inserting an AutoCAD 2007 floorplan of a data center, overlaying Visio server shapes, adding Data Graphics to show cabinet temperatures and then publishing the diagram to Visio Services for display in a web dashboard.  Thus, while CAD integration does not fall under the three investment areas described on Day 1, it was high on the team's priority list for Visio "vNext" given the applicability to data visualization scenarios across several diagram types.

     

     

    Day 2 also featured demonstrations of new capabilities for developers and shape designers:

    RibbonX

    Visio "vNext" adds support for RibbonX, the API for the Office Fluent user interface.  Existing Visio solutions with custom UI will work unmodified in the Ribbon, but solutions can use RibbonX for a much richer integration into the Ribbon.

    Structured Diagrams

    Visio "vNext" allows solution developers to work with Visio diagrams at a logical level instead of at the physical level.  Visio exposes relationships between shapes that can be discovered and traversed to simplify the understanding of the diagram structure.  Three common relationships are defined: connectivity, containment and callouts.

    Visio Services API

    Visio "vNext" provides a JavaScript API for accessing and enhancing diagrams rendered by Visio Services.  Web page scripts can extract information about the shapes displayed in the diagram for use in another frame.  Scripts can also highlight shapes, place overlays on shapes and manipulate the diagram's viewport for pan and zoom.

     

    The feedback received over the last two days at the Visio Conference has been tremendous.  We're happy to see people so enthusiastic about our Visio "vNext" plans.  There is still much work to be done, and we hope that the Visio community will continue providing feedback as we disclose more over time.

     

  • Visio Insights

    Microsoft Visio 2010: Business Process Diagramming and Validation (A Visio Book)

    • 1 Comments

    The Visio team would like to congratulate Visio MVP David Parker on his new book, Microsoft Visio 2010: Business Process Diagramming and Validation. This book provides an in-depth coverage of creating custom validation rules in Visio 2010.

    FrontCover

    After reading Microsoft Visio 2010: Business Process Diagramming and Validation, a few key things were apparent. First, this book covers a variety of topics. The book begins with an overview of process management in Visio 2010 and introduces Visio users to an assortment of new Visio 2010 features. Then two chapters are devoted to the Visio Object Model and the Visio ShapeSheet: powerful tools that combine to provide the unique development experience within Visio. Of course, there is a strong focus on the new validation feature but a reader will learn about a wide range of Visio topics.

    Second, the book provides a large quantity of coded examples and even a chapter devoted to a worked example. These clear, well-thought-out examples are great for those who want to experiment in Visio as they read the book.

    Finally, the book is a great reference for those interested in building custom validation rules. In Visio 2010, validation enables companies to ensure that their diagrams meet certain compliancy, business standards or more general requirements. Visio provides some built-in validation rules, but anyone can create custom validation rules to meet their own needs: you can specify your own custom diagram requirements, for any type of diagram, and Visio will verify these requirements for you. This book was written to teach people how to master this process of designing, implementing and sharing custom validation rules.

    For more information about the book, check out David Parker’s book web site. We also have a chapter from the book, Understanding the ShapeSheet, available on MSDN.

  • Visio Insights

    Visio 2010 Beta Released

    • 8 Comments

    This morning Microsoft announced that the Beta versions of Microsoft Office 2010, SharePoint Server 2010, Project 2010 and Microsoft Visio 2010 are now available!  You can download Visio 2010 Beta here.  This is a public Beta, so anyone can install and use it.

    Changes in the Beta

    Visio 2010 Beta has numerous refinements based on customer feedback from the Technical Preview.  The most visible changes can be found in the Backstage View.  This area has been redesigned to feel more integrated with the rest of the Ribbon, as is explained in the Office 2010 Engineering blog.  Also there are several visual updates.  In the screenshot below, you can see the new look of the Backstage View found under the File tab.

    image 

    Saving files to SharePoint is also different in Visio 2010 Beta.  Now saving to a SharePoint location, saving to a Visio Process Repository and publishing to Visio Services have been combined into a single place.  You simply choose a location and then select whether to save out a standard Visio Drawing or a Visio Web Drawing.

    image

    In the other ribbon tabs, you will find visual updates to Themes and a more functional set of Callouts.  For improved ease of use, we’ve refined the behaviors of several diagramming features including adjusting the sensitivity of AutoConnect.

    image

    image

    You will also find functional and visual updates to Containers, Cross-functional Flowchart shapes, BPMN shapes, Data Graphics Legends and Wireframe shapes.  If you created diagrams with these shapes in the Technical Preview, please be aware that your existing diagrams will have the Technical Preview version of the shapes while new diagrams created in the Beta will have the new versions of these shapes.  Also for Cross-functional Flowchart diagrams, significant shape and functionality changes mean that Technical Preview diagrams will open in the Beta but will not be editable.

    More information about the features of Visio 2010 can be found on this blog.  End user help is also available on the Microsoft Office Beta site.

    Visio Services Beta and Visio SDK Beta

    Coinciding with the release of Visio 2010 Beta, we are releasing the Beta version of Visio Services as part of Microsoft SharePoint 2010 Beta.  You can download SharePoint 2010 Beta from MSDN here.   In addition we are releasing a Beta version of the Visio Software Development Kit, a download for solution developers.  We will provide more information about the Visio SDK Beta in an upcoming post.

    Send Us Your Feedback

    We encourage you to download the Beta and give us your feedback.  We’re rapidly approaching the end of the Visio 2010 development cycle, and your feedback is essential to ensure a high quality final product.  You can comment on the posts on the blog or use the Send a Smile tool to let us know what you think.

    Send A Smile in Windows Taskbar

  • Visio Insights

    Using Visio 2007 Professional's data connectivity features with timelines

    • 0 Comments

    Visio 2007 provides data connectivity support for a number of data sources such as Excel, SQL and SharePoint Lists.  One interesting scenario is to pull in schedule information from a SharePoint calendar (a special list type in SharePoint) to generate a Visio timeline. 

    Visio MVP David Parker has posted an article that illustrates how to use Link Data to Shapes and the External Data window to bring in the SharePoint data and drop linked shapes onto a timeline.  As David shows, the "secret" is to map the names of the date data fields to the names of the Shape Data properties used by Visio's timeline shapes.  That way the timeline shapes don't just carry the SharePoint data around; they use the data to control their position on the timeline.

    Renaming field names in the External Data window

    This mapping technique is useful for more than SharePoint lists and for more than timelines.  Use it whenever you want to link data to existing Shape Data properties on a shape.  You don't need to go rework the data source to match Visio's property names.

     

  • Visio Insights

    Video: Process Diagrams in Visio 2010

    • 5 Comments

    Recently Mark Nelson from the Visio team sat down with Harry Miller (off-screen) to discuss some of the improvements in Visio 2010 related to process diagrams.  The video includes explanations of our Process Management investments as well as demos for Cross-functional Flowchart, BPMN diagram and Validation features.

     

    Get Microsoft Silverlight

     

    The conversation is the latest in a video series titled “Visio: Drawing on Experience” posted on Microsoft TechNet.  Other videos featuring some of our Visio MVPs can be found here: http://edge.technet.com/Tags/Visio/

  • Visio Insights

    Flowcharts in under a minute

    • 1 Comments

    Visio has several features that are designed to make it easy to create a diagram quickly. Here are three examples of ways to help you create a simple flowchart in under a minute.

    Example 1: Capture a flow quickly

    Let’s assume you have a pretty clear idea of what the steps are that you want to diagram and the order that you want them in, so all you need to do is capture the flow quickly. Once you drop your first shape you can use the AutoConnect feature to fill in the rest of the diagram quickly (for more details on AutoConnect, see the blog post here.). When you hover over the selected shape, four arrows will appear. Hovering over the triangle that points where you want the shape to appear will display a mini-toolbar to let you pick any of the first four Quick Shapes from your current stencil. One click on the shape you want will add the shape, a connector and uniform space between the shapes.

     clip_image002clip_image004

    The ability to add connected shapes with a single mouse click works really well when your goal is to get shapes onto the page quickly and then add text and formatting. Once you’ve got the shapes in place, you can double-click on shapes and connectors to add the labels and, as a final step, click on the Design tab and pick a theme to make it look really professional. In just over twenty mouse clicks and some typing, you’ve got a finished flowchart in well under a minute.

    clip_image006

    Example 2: Get the details, then organize

    But suppose you know what steps you want to diagram, but you still need to figure out how to lay them out and how they all fit together. How can you make that process quicker? You can start by adding a shape for each step you know you need and labeling it as you go – don’t worry about where you place them for now, just concentrate on getting all of the items on the page. Once you think you have shapes for all of the major steps you need on the page, you can start dragging them around and organizing them into the real flow. Don’t worry about connectors for now, just get the shapes where you want them. Alignment guides make it easy to ensure that spacing is even; as you drag shapes near each other the guides will appear to help you out.

    clip_image008

    Once you’ve got shapes where you want them, those little AutoConnect triangles can help you out again. Hover over the triangle which points to the next shape just a little longer than it takes for the shapes toolbar to appear and a connector will appear. Click and it will draw connectors for your shapes automatically.

    Since you’re building your diagram as you go, it’s easy to forget a step. Don’t worry, that’s not a problem. If you’ve already connected shapes and realize that a step belongs between them, just drag the new shape over the connector between the two shapes where you want the new one. You’ll see the cursor connection points highlight, and when you drop the new shape it will be inserted between the two shapes and connected up. By the way, if you delete a connected shape, Visio will automatically reconnect the remaining shapes, too. Note that the connectors are using dynamic glue by default. You can learn more about dynamic glue here.

    clip_image010

    Just like the first example, you can add some theming to make your diagram look great and you’re done.

    Example 3: Using a variety of shapes

    As a final example, suppose you want to make a flowchart for a presentation and you want to use combine flowchart shapes with some non-flowchart shapes to make it look fancier. Because you want to use a variety of shapes, you want to be able to grab shapes from a number of different stencils to build up a good looking diagram. The AutoConnect triangles can help you do this quickly, too. This time, instead of hovering over the triangle and selecting a shape from the dialog that pops up, you can drag any shape from a stencil in the shapes pane, move it over the shape you want it to connect to and, when the triangle highlights, drop it to add a connected shape.

    clip_image012

    This allows you to quickly create a diagram that uses many different shapes from multiple stencils.

    That’s it!

    If you take some time to experiment with AutoConnect and its various features, you’ll find that just a minute is long enough to generate a simple flowchart that looks good and communicates well. Even better, you’ll find ways to shave some valuable time off of those bigger projects, as well.

    As always, we value your feedback. Please let us know if you have any feedback on Visio 2010, Visio Services, or suggestions for blog posts you would like to see.

  • Visio Insights

    Drag, Drop, Done

    • 2 Comments

    We're going to kick off the Visio Insights blog with a series on the essential features that make Visio the popular diagramming application it is today.  In each topic, we'll cover the basics from a user's perspective and then dive more deeply into the technical details.

     

    Essential Feature:  Drag and Drop

    Fifteen years ago a new diagramming product hit the marketplace with a revolutionary way to draw.  Rather than construct drawings from geometric primitives such as lines and arcs, Visio offered the ability to drag and drop pre-built shapes.  One of the early tag-lines for Visio was Drag, Drop, Done.  Making diagrams in Visio is more a matter of assembling than drawing, and this mechanism made diagramming approachable for many people.

     

    So how does drag and drop really work?

     

    The pre-built shapes are called Masters, often referred to as Master shapes.  The masters are organized into documents called Stencils.  The stencils are displayed on the left side of the drawing workspace inside the Shapes window.  To add a shape to the drawing, you drag one of the masters from a stencil to the drawing page.

     

    Behind the scenes Visio does a lot of work to place that shape on the page.  A stencil is a separate document from the drawing, so Visio first must copy the master from the stencil to the drawing document.  (This operation is generally not visible to the user.  If you want to see the masters in the drawing document, go to File > Shapes > Show Document Stencil.)  Then Visio creates an instance of the master shape and places it on the drawing page.

     

    If you drag the same master shape out from the stencil again, Visio checks to see if there is already a copy of the master in the drawing document.  If the master is already present, Visio skips the copy operation and proceeds to create another shape instance to place on the drawing page.  Visio checks a property on the master called the UniqueID to determine if two masters are alike.  Whenever you edit a master, the UniqueID changes.  Thus it is possible for two masters to have the same name, but Visio will know that the masters are different by their UniqueIDs.

     

    UniqueID lets Visio distinguish between two masters with the same name, but users may have more difficulty telling them apart.  To avoid that problem, Visio forces the name of each master within a document to be unique.  When you add a different master by the same name to a document, Visio automatically renames the incoming master by appending a decimal point and a number such as Person.1 .  There may be a scenario where you want Visio to interpret masters with the same name as being identical, so there is a property on the master that you can set to “Match master by name on drop”.

     

    Why go through all these steps to drop a shape on the page?  It ensures that Visio documents are always portable.  There are no external references to masters in a Visio document, so you can pass documents around and not worry about missing information.  Master shapes are a powerful concept, and we'll have more to say about them in a future post.

     

     

  • Visio Insights

    Video: Adding a Data Graphic Legend in Visio 2010

    • 0 Comments

    The video below shows how to add a Data Graphic legend to a drawing using C# code. How might you use this code within the context of constructing diagrams with Data Graphics?

    As mentioned in a previous blog post, Visio Professional 2010 and Visio Premium 2010 use container shapes to create legends for data graphics. Along with this new feature, the Visio 2010 Object Model includes new APIs that allow you to manipulate container shapes programmatically – including the Page.DropLegend method that allows you to add a Data Graphics legend to your drawing using code.

    We’ve created this how-to video about using C# to add a Data Graphics legend to a drawing page. While creating this video, we considered some of the larger scenarios where this API might be used. We’d like some feedback from you, the Visio developers and users, to learn more about how you use these features:

    · How often do you create Visio drawings that are linked to data? Do you link that data to shapes? Do you use Data Graphics to visualize the data contained in the shapes?

    · Which templates do you use most frequently to represent external data?

    · When you link a drawing to external data, which data providers do you most commonly connect to (e.g. Excel, Access, SharePoint lists, SQL Server, etc.)?

    · What other tasks do you frequently perform in addition to linking a drawing to external data?

    · How often do you use code to manipulate external data in Visio, using VBA, C#, or VB.NET? Have you ever applied data graphics to a Visio diagram using code?

    Please watch the video and submit your feedback using the comment box below this post.

    Add a Data Graphic Legend in Visio 2010 through code.

    Note: The Data Graphics legend feature is only available in Visio Professional 2010 and Visio Premium 2010.

  • Visio Insights

    Joining the Club

    • 0 Comments

    In an earlier post we talked about Visio being a general purpose diagramming and drawing application that enabled specialized behavior through its extensibility model.  Custom shapes are combined with custom code to create an intelligent diagramming solution for a particular scenario.  Sometimes users like to take this extensibility notion even further by creating their own shapes to work with the solution.  We inevitably are asked how these new shapes can “join the club” or participate in the specialized behavior.

     

    Unfortunately there is no single mechanism for registering a shape with a solution or converting a shape to work with a solution.  Some Visio solutions provide this capability.  Others do not, forcing the user to discover the secret handshake with the solution.  We’ll look at a specific example in this post.

     

    Legends

    The Legend feature can be found in Visio’s Brainstorming template, or the Legend Shapes stencil can be opened from File > Shapes > Brainstorming.  Special legend shapes are added to the diagram, and the Legend shape displays them with counts and labels.

     

     

    Now imagine that you need a new shape to easily identify issues to be resolved.  Here is a simple shape created with the Freeform tool.  The initial alignment box for the shape is not ideal, but that can be fixed using Shape > Operations > Combine to fit the geometry into a nice upright rectangle.

     

    It would be helpful to tally the issues in the diagram and have the total displayed in the legend as well.  To do this, open the Document Stencil for the diagram by going to File > Shapes > Show Document Stencil.  Then drag the issue shape over to the stencil.  You should rename the shape from Master.11 (or similar) to Issue.  You could also clean up the icon if desired.

     

    Next we need to make the shape work with the legend.  Drag the shape from the Document Stencil and drop it on the legend shape in the drawing.  The following message will appear.

     

     

    Choose Yes and then delete the shape sitting on top of the legend.  Now drag out Issue shapes from the Document Stencil to annotate the drawing.  The legend should reflect the total number of Issue shapes present.

     

     

  • Visio Insights

    ShapeSheet Formula AutoComplete & Other Improvements

    • 1 Comments

    In this post, we’ll be covering improvements to the ShapeSheet in Visio 2010 that make it easier for shape developers to create and modify existing Visio shapes.

    For those who don’t know, Visio shapes are more complex than they may seem at first; behind each shape is a ShapeSheet (you can get more details here and here if you're unfamiliar with the ShapeSheet). In Visio 2010, you can access a shape's ShapeSheet by selecting the shape in question and clicking the "Show ShapeSheet" button on the Developer tab. If you don’t have the Developer tab up already, learn how to turn it here. Once you’re in ShapeSheet mode you’ll see the following user interface:

    image

    As you navigate through the updated ShapeSheet experience you’ll quickly stumble on our improvements. In the ShapeSheet editing window (1 above), Visio 2010 now facilitates user input with a new feature called ShapeSheet Formula AutoComplete. The ShapeSheet user interface has also been simplified considerably by the creation of the ShapeSheet Contextual Tab (2 above) to facilitate common ShapeSheet actions.

    Let’s take a deeper look into each improvement.

    ShapeSheet Formula AutoComplete

    One key features of the ShapeSheet is that it enables Visio shape developers to create a dependency between one shape property (also known as a ShapeSheet cell) and another through a formula. For example a shape developer can set height = 2 * width.

    To this day, to become a proficient shape designer, you had to memorize all 345 cell names, 17 row names, 40 section names and the syntax to 181 ShapeSheet functions – not an easy task! Visio 2010 however makes your life much easier by introducing a new feature called ShapeSheet Formula AutoComplete. This feature helps you compose ShapeSheet formulas by:

    1. Providing a context-sensitive list of ShapeSheet formula keywords as you type. All ShapeSheet functions, section names, row names and most** cell names are accessible via ShapeSheet Formula AutoComplete (**Visio doesn’t surface cells in non-named rows such as the “X1” or “Y1” rows in the Geometry section). As you compose a formula in a cell, Visio scrolls a list of keywords that are appropriate for the current context and selects the keyword that most closely matches what you're typing.

    Take a look below to see ShapeSheet Formula AutoComplete in action. As you type “P-R-O”, the list of keywords scrolls to the “Prop” section name which also gets selected as Visio’s best guess. After auto-completing the section name by using “.”, Visio replaces the keyword list with one that makes sense in this new context, in this case the shape data item “CostOfShape”.

    image

    Also notice that Visio helps you locate the keyword you’re looking for by sorting them alphabetically and tagging them with one of the icons below depending on what type of keyword it is.

    image

    2. Providing a quick input mechanism for ShapeSheet formula elements. Once you've typed enough letters to uniquely identify a ShapeSheet keyword, you can simply hit "Enter" or "Tab" to complete the keyword. Depending on context, the ",", ".", "!", “*”, “+”, “-”, “/”, “[”, “(“ and “)” symbols will also do the trick.

    3. Providing a definition of the ShapeSheet items. If you're not sure of the definition of a ShapeSheet keyword, a tool tip appears next to the currently selected keyword in the AutoComplete list with a definition for it. For example, below, is a definition for the PATHSEGMENT function, one of the new ShapeSheet functions in Visio 2010.

    image

    4. ShapeSheet function parameter browsing. As you compose a ShapeSheet function, the function signature appears above the cell in a tooltip. The bolding in the tooltip changes as you progress through a function’s arguments.

    image

    5. ShapeSheet formula parenthesis matching. As you close a parenthesis pair with a ")" character, ShapeSheet Formula AutoComplete will highlight the matching open-parenthesis in red.

    image

    ShapeSheet Formula AutoComplete is available in the following textboxes, dialogs and windows throughout Visio 2010:

    • In a ShapeSheet cell
    • In the ShapeSheet formula edit bar
    • In the new “Edit Formula” dialog which you can launch from the ShapeSheet contextual tab
    • In the “Insert Field” dialog, when typing in a custom ShapeSheet formula
    • In the “Edit Data Graphics” dialog, wherever you have the opportunity to add a custom ShapeSheet formula.

    The ShapeShee Formula AutoComplete feature can be toggled off through one of these entry points:

    • Toggling the relevant option in the “Visio Options”>“Advanced” dialog.
    • Toggling the value of the Software\Policies\Microsoft\Office\14.0\Visio\Application\EnableFormulaAutoComplete registry key.
    • Toggling the value of Application.Settings.EnableFormulaAutoComplete API property.

    ShapeSheet Contextual Tab

    Apart from ShapeSheet Formula AutoComplete, the ShapeSheet has gotten a facelift thanks to the Fluent UI – all ShapeSheet related commands are now in one place. Take a look at the ShapeSheet contextual tab below.

    image

    In more detail:

    Chunk

    Button

    Functionality

    View

    Formulas

    Toggle the “formula” view of the ShapeSheet – all cell formulas are shown.

     

    Values

    Toggle the “value” view of the ShapeSheet – all cell results are shown.

     

    Sections

    Surfaces the “View Sections” dialog which lets you show or hide ShapeSheet sections.

     

    Style Explorer

    Surfaces the “Style Explorer” pane that lets you view and edit styles in the current drawing.

    Section

    Insert

    Adds optional sections of your choice to the currently selected ShapeSheet.

     

    Delete

    Deletes the optional section you have currently selected.

    Rows

    Insert

    Adds a row to the optional section you have currently selected.

     

    Delete

    Deletes a row from the optional section you have currently selected.

    Editing

    Edit Formula

    Surfaces the “Edit Formula Dialog”, seen below, which gives you more room to enter long equations as well as the possibility of adding carriage returns to your formulas to improve legibility. As you can see below, ShapeSheet Formula AutoComplete is still active in this dialog.

    image

    Note that you can also open this dialog by using the “ctrl+e” key combination.

     

    Shape Data

    Adds a ShapeData row to the currently selected ShapeSheet.

     

    Hyperlink

    Adds a Hyperlink row to the currently selected ShapeSheet.

     

    Shape Action

    Adds an Action Row to the currently selected “Actions” section.

    Formula Tracking

    Show windows

    Toggles the visibility of the “Formula Tracing” window.

     

    Trace Precedents

    List in the “formula tracing” window all the cells the currently selected cell depends on.

     

    Trace Dependents

    List in the “formula tracing” window all the cells that depend on the the currently selected cell.

     

    Back

    Jumps to the previous cell in the formula tracing history.

     

    Forth

    Jumps to the next cell in the formula tracing history.

    Using the Fluent UI, Visio can now enable and disable interactively the ShapeSheet operations that you can take against a particular cell while you're editing it; this removes some of the right-click menu hunting you may have done in the past.

    Also…

    The final change we’ve made to the ShapeSheet experience in Visio 2010, is to enable shape designers to open one ShapeSheet window per shape instead of re-using the same window for all shapes, the latter behavior being the default in previous releases of Visio.

    Try it out!

    Download Visio 2010 Beta and start building shapes with the 2010 ShapeSheet -- we're interested in hearing what you think of Visio's new and improved ShapeSheet experience. You can send us your feedback by either commenting on this blog post or sending us information via Send a Smile.

Page 5 of 8 (181 items) «34567»