Update to multiSelect – tracing sub-shape connections in Visio

Most of my Visio diagrams have simple connections between shapes, and my previous post about connections used a flowchart as an example (see https://blog.bvisual.net/2016/08/09/understanding-visio-connections/ ). However, it has come to my attention that some Visio developers add connection points to sub-shapes of Visio group shapes, and then connect between the sub-shapes. This means that the code in my previous article would need to be adapted to cater for this scenario. It has also meant that I needed to update my free multiSelect Visio add-in needed an update. The updated version (1.0.6.0) is for Visio 2010+, and is available from http://bvisual.net/Products/multiSelect.aspx .

multiSelect Tracing connected sub-shapes

I have added in three more options into the multiSelect add-in that work with the Parent, Children and Siblings actions:

  1. Keep source selected – previously the actions dropped the original shape from the selection.
  2. Include sub-shapes – it can take longer to explore the sub-shapes of large shapes, so I made it optional
  3. Prefer sub-shapes – if connected to a sub-shape, then select the sub-shape rather than the parent group shape

 

There were a couple of challenges in adapting the code.

  1. Recognising that the connected shape was a sub-shape
  2. Selecting a sub-shape programmatically

 

I solved the first challenge by testing if the Connect.ToSheet.ContainingShape.ID equals 0 for the end of a connector. If it is, then the shape it is connected to has the page as a parent; if not, then the ID is the parent shape, which can be retrieved using Page.Shapes.ItemFromID(…).

The second challenges was surprisingly more difficult. The Window.Select(…) method has an argument for the type of selection. The trick is to select the group shape first using visSelectArgs.visSelect, and then to immediately select the sub-shape using visSelectArgs.visSubSelect.

7 Responses to “Update to multiSelect – tracing sub-shape connections in Visio”

  1. David Says:

    David,
    Very nice!!!

    Knowing that the diagrams/schematic can be quite large, thus requiring multiple pages, can you make it continue to the next page?

  2. David Says:

    Maybe using a continuation or next page or to/from shape?

  3. Philippe LE PAGE Says:

    Hi David

    I can’t install your multiselect addin on my Visio Pro 2016. The installation succeeds however I can’t see new addin on Visio and I can’t add the multiSelect.dll as an addin…

    Philippe

    • davidjpp Says:

      I have it installed ok in my copy of Visio Pro.
      Does it appear under Active Application Add-ins in File / Options / Add-ins ?
      Please be aware that nothing shows in the Visio UI until you select a shape.

      • Philippe LE PAGE Says:

        Thank you for your quick reply. No it doesn’t appear under Active Application Add-ins in File / Options / Add-ins, that’s why I try to add it manually. BTW I don’t know if my copy of Visio Pro is a 32 or a 64 bits version, so I’ve tried both.

      • davidjpp Says:

        You can check under File / Account / About
        multiSelect should install 5 files in \bVisual\multiSelect
        Does it appear in any other panel on File / Options / Add-ins ?
        Do you have anything ticked under File / Options / Trust Center / Add-ins ?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Chris Webb's BI Blog

Microsoft Analysis Services, MDX, DAX, Power Pivot, Power Query and Power BI

davecra.wordpress.com/

Microsoft Office 365 Development, and more...

PowerShell.Amsterdam

Automate, Accelerate, Accurate

johnvisiomvp

Life with Visio and other Microsoft Toys!

Title (Required)

Windows Server Essentials Tips & Tricks

Nilsandrey's Weblog

Just another WordPress.com weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Shapes, Stencils, Drawings Templates, Tutorials, Tips & Developer Info for Microsoft Visio

Hannes's Virtual Earth

Tips & Tricks around Mapping and Cloud Computing

Pluralsight blog

be smart, be clear, be visual ...

%d bloggers like this: