Fixing Connector Gaps in Visio

By stretch | Thursday, November 18, 2010 at 4:13 a.m. UTC

There is a problem with drawing network diagrams in Microsoft Visio that has been bugging me for years. Earlier this week, I finally set about finding a solution for it, and I'm happy to report I was successful.

The problem occurs when attaching connectors to a shape, such as a router or switch icon. By default, connectors are terminated when they reach the target shape's rectangular border, not the edge of the shape itself. This is especially problematic with round shapes like our beloved router icon. (The icon below is from a set produced by VSDfx.)


So how do we fix it? Theoretically, modifying the glue settings in Visio so that connectors attach to a shape's geometry should work, but that hasn't been my experience. Instead, we're going to do a bit of a hack.

First, select the target shape and open its ShapeSheet. In Visio 2010, the ShapeSheet button can be found in the Shape Design section of the Developer toolbar (which is not shown by default). If the ShapeSheet button is disabled, make sure you have selected the shape first.

Next, scroll to the bottom of the ShapeSheet to the Shape Layout table. Change the value of the ShapeFixedCode parameter to 128 (visSLOFixedNoFoldToShape). Hit enter to apply the change and close the ShapeSheet.


Now, redraw one of the connectors to reattach it to the shape. It and any other connectors attached to the shape should now all meet at the center of the shape. Vertical and horizontal lines may need to be redrawn separately.


Finally, move the shape to the foreground. In Visio 2010, this can be done by right-clicking on the shape and selecting Bring to Front. Now you have some very smooth-looking connectors which will follow the shape as it is moved.


About the Author

Jeremy Stretch is a network engineer living in the Raleigh-Durham, North Carolina area. He is known for his blog and cheat sheets here at Packet Life. You can reach him by email or follow him on Twitter.

Posted in Visio


IPv6Freely (guest)
November 18, 2010 at 4:17 a.m. UTC

Cant say I've ever had that problem... my connectors have always directly attached to the shape. The only time they haven't is when I used a PNG or GIF image, rather than an actual icon.

Good info to know for if I do see it happen in one of my drawings, though.

November 18, 2010 at 10:09 a.m. UTC

Nice....I am using that trick for almost 2-3 years for every one of my drawings......Playing with z-axis gives a lot more flexibility....

Marcos (guest)
November 18, 2010 at 1:15 p.m. UTC

Hi Jeremy,

I never comment so first let me thanks you (and the people who comment) for sharing your knowledge and your lab. I've recommended this page to friends and partners.

About this blog post, I would like to recommend Dia. It's free software and it's available for Linux, Mac and Windows.

November 18, 2010 at 1:38 p.m. UTC


What I normally do is add a connector point in the middle of the router. As a general case, I add connector points on the locations that I want within that shape.

Works quite well for me.

November 18, 2010 at 3:07 p.m. UTC

@Marcos: I've messed around with Dia before. While it's nice that Dia is free and cross-platform, it's far from sufficient for professional network diagrams.

November 18, 2010 at 7:00 p.m. UTC

Great post! I was just fighting with visio connectors in these days.

November 18, 2010 at 9:25 p.m. UTC

Lovely! Thanks dude this is priceless

GT (guest)
November 19, 2010 at 1:04 p.m. UTC

I gave up on Visio a long time ago because of too many annoying quirks like this. I have since been using Omnigraffle, which only works on Mac, but is great for network diagrams.

November 19, 2010 at 7:05 p.m. UTC

If you zoom in far enough, you can CTRL+click to add connection points around the edges (it snaps once you get past the grid). Then save the new shape in your own library for future use.

December 1, 2010 at 7:27 a.m. UTC

Very Nice....

December 28, 2010 at 8:05 a.m. UTC

Sounds cool, But I guess you can always connect to the center of the router and bring your router in Front, and that would solve the problem.
I usually have more of a problem connecting to square shapes like a MLS. The connector always ends up a broken line, so my fix is holding the shift button while drawing the line..

Comments have closed for this article due to its age.