Home » Development

When 2D Glue Breaks

Submitted by on June 14, 2007 – 1:05 pm | | 22892 views 7 Comments

« »

If you’ve used Visio’s 2D glue capabilities, you’ll know it’s pretty neat. Not only can you glue shapes to one-another, but you can get them to snap to a direction as well! However, if you’ve tried to heavily exploit this feature, you might have run into some problems.

It turns out that there is a limitation on the number of shapes you can chain together. On my system, in both Visio 2003, and Visio 2007, I’ve found that I can chain up to 10 shapes together. The ShapeSheet glue-formulas for the 11th shape and beyond aren’t broken, it’s just that Visio leaves them behind when you drag.

Edit: 2008.02.10: The next version of Visio has fixed this problem. Thanks Visio team!

(By the way, we’ve covered 2-dimensional glue in a previous article: Connection Point Directions and Types This post also provided tools for configuring 2D connection points. Have a look!)

Let’s Break Something!

I tested by creating shapes that were simple rectangles, with two connection points each. The left-side connection point was set to Type = 2, so that it would glue to the right-side connection point of a shape to the left. A chain 10 shapes long was the limit. An 11th shape would not follow if the first shape was dragged. The situation looked something like this:

Here we can see that 13 shapes are chained together using 2D Glue. Clicking on shape 11 reveals red handles that indicate it is glued to shape 10.

When 2D Glue Breaks: 11th Shape left behind

When we drag the shape 1, then next 9 follow along, but the glue limitation leaves 11, 12 and 13 behind. If we drag shape 11, then 12 and 13 will still follow along. the glue hasn’t been disrupted.

When 2D Glue Breaks: Glue Breaks

It gets even weirder: if you net-select all 13 shapes, and move the selection, the glue still breaks and 11, 12 and 13 still get left behind! Even though you selected them together! It seems the 2D-glue has some sort of priority over a Selection.

A Possible Solution?

We were recently cleaning out the old Visio Guy Inbox and came across an e-mail that discussed this problem. According to the Visio development team:

There is a threshold of 25 shapes (including sub-shapes) for showing a bitmap image of your selection while dragging. Above this threshold Visio only shows a rectangular outline. Using 2D glue is dependent on the bitmap drag image being available, so there is in effect a limit on the complexity of shapes that want to support 2D glue.

There is a registry key to remove the 25 shape threshold. Set: “HKCUSoftwareMicrosoftOffice12.0VisioApplicationDragBitmap” to “REG_SZ”. The side effect is that you will encounter degraded performance as you drag more complex shapes around.

This quote actually deals with two problems, one having to do with when a preview of a shape is generated. Normally, if a selection has more than 25 shapes (including sub-shapes), then Visio just shows a rectangle while dragging, instead of generating a representative image of the selection. This information is also covered in this post on Visio Insights. And, it seems, the chaining of 2D glue is related to the this drag-preview generation.

We tried changing the registry setting mentioned above from 3 to 2, but it had no effect on the breaking of the chain. It still broke between shapes 11 and 12. The registry setting had no effect for either Visio 2003 or Visio 2007.

Also note, you’ll want to make sure that all Visio settings are shown in the registry by going to Tools > Options > Advanced and check ing “Put all settings in registry”.

We’d like to know if any of you Visio Fans have gotten this to work, or perhaps the Micro-Visites will feed us some some more choice information via the comments-section below…


  • Hi Chris,

    As best as I can determine, the reason that 2-D glue breaks after 10 shapes is that it technically relies on a circular reference in the Shapesheet to achieve the result. Visio has a hard-coded limit on the number of recalc iterations it will use when attempting to resolve circular references. This limit is 40, which is a multiple of 10. I have not gotten an exact explanation about the relationship though.

    A second issue with 2-D glue is that you cannot make any shape transform change on a shape using 2-D glue and have Visio preserve the glue. For example, resizing shape #2 in your test breaks the glue, even if the connection points stay right on top of each other.

    Suffice it to say that 2-D glue wasn’t designed with chaining in mind. There are several possible remedies under consideration in the future. The easiest is to crank up the circular reference limit, which could be much higher with today’s CPUs. We might be able to address the break-on-transform problem as well. A more complicated solution would be to redesign 2-D glue.

    I’d be very interested to get scenarios from people that use 2-D glue. Let us know what you are trying to do.


  • zhuravsky says:

    Hi all,

    If in your example shapes will contain 24 or more sub-shapes then glue will not work (but with VBA it is still possible glue shapes to each other)

  • Visio Guy says:

    Dobrij Djen Zhuravsky,

    The 24 sub-shape number also affects the drag-preview, curiously. If you have less than 25 sub-shapes in a group, then you’ll see the shape when you drag it (Visio generates a bitmap of the shape). If you have more sub-shapes, then you’ll just see a dotted-outline when dragging.

    Nothing to do with glue, but somehow related to this discussion…


  • Barry says:


    This issue, along with a couple other 2D glue issues, will be resolved in the next version of Visio.



  • UNV says:

    There’s another issue relating 2D glue:

    I’ve just produced a set of table columns glued together (in the center of column’s left border is outward connection point and there’s inward one on the right side).

    Now I need to extend columns height.

    I’m selecting the first one and resizing – other columns don’t though move glued to the moving connection point. Seems correct though it’s not what I want. Though: the first column rotation causes rotation of the other glued columns.

    Selecting all of them and resizing (using bottom action point): all the columns except the first moves down and forming something like stairs! Completely incorrect.

    What to do? The last test (for artificial intelligence): creating two identical squares: one with 2 inward connection points on the right side, another with 2 outward ones on the right side. Trying to connect both. Of course, it fails – only one point at a time is connected (though they’re perfectly sized and fit). I’ll explain myself: it’s now a common gesture, to use two fingers on multi-touch screen to rotate or resize picture.

    So, I can’t adjust my columns height when they’re glued. This is strange: glued shapes perfectly react to a rotation.

    Visio 2003

  • Michael Harrell says:

    are their any limitations to the number of items clued on a single page? regardless of weather they are glued to each other of not?

  • Martin says:

    @Barry: Microsoft didn’t use the elapsed time of almost exactly 6 years to fix this in Visio 2010. I guess their developers have been busy doing “fancy stuff” like ribbons. 🙁
    However, setting HKCUSoftwareMicrosoftOffice14.0VisioApplicationDragBitmap from 3 to 2 worked for me. 🙂

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" extra="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.