Visio Stencils Library for Wiring Diagrams

A lot of professionals rely on AutoCAD or other CAD-based tools for broadcast facility design. Visio is typically used for making concept and workflow drawings, sometimes also for network and rack diagrams. But can we use less expensive tool for more design tasks? Despite scepticism I think that Visio has good chances. It’s very flexible software, it can be used as a replacement of other CAD systems in some cases (not all, of course), but require some kind of tweaking.


“Look & feel” of Visio is very different than CAD ones. Many CAD users prefer to use bright lines and dark backgrounds; it’s much more eye-friendly. Visio is WYSIWIG-style diagram editor, there is no simple way to change or switch background and grid colors. Well, it is partially possible: in Visio 2003 background color can be changed in options, but not in other versions: it’s always white. Grid color still can be changed in registry (HKCU\Software\Microsoft\Office\…\Visio\Colors). Anyway, it’s just inconvenient to restart Visio every time just to change a ‘look’. Starting from version 2007 there is the powerful theme ‘engine’, so why not to tame it? In my template I decided to use a small set of very minimalistic themes optimized for wiring diagrams, and completely turn off any other themes and effects:


It’s almost like old-good Visio 2003. Now I can switch only between my themes or turn them off before printing:


Built-in VBA code changes colors and backgrounds depending on the current theme. It’s not as quick as it works in CAD programs – switching themes may take minutes depending on diagram complexity – but it’s still better than nothing. For a while I haven’t found a better way, fortunately it’s rarely needed. Maybe it will be easier in Visio 2013, or some “hacking” may help?

Small note about colors: it’s more safe to use system and/or custom colors then theme-dependent ones: they’ll always stay the same. Even more: I’m sure that it’s better do not use colors at all to avoid any misunderstanding.

“Feel” is more complex thing, there are many things which CAD users may miss in Visio, e.g. there are no “classic” command line window. But there are some alternatives: as a minimum there is built-in VBA. More advanced technics may include using of PowerShell or Python scripts and VB/C# programming. The simplest way is to implement all the necessary operations as macros in VBA.

The real advantage of Visio is SmartShapes, which may contain some built-in logic, call add-ons etc. I use this feature in my template to implement resizable 2D blocks with variable count of input/outputs and “smart” wires that can detect which blocks they’re connected to and assign matching connector types:


Wiring diagrams are all about boxes and arrows, so there is no need in large shape libraries, they just have to be more universal and flexible. “Component” shape covers 99% of needs; I also added some more shapes:


Each shape has a rich set of data and supported by the VBA code in the template.

There are a lot of complains about ribbon UI in Visio and other Office programs, but I think it’s not so bad and can be really very convenient. In my template I placed most often used macros and reports in a special ribbon tab:


Built-in reporting with export to Excel may be used for making lists of equipment and cables. All the logic is implemented in VBA code in the template file. It’s the simplest way of distribution, but some later after polishing I’ll probably made an add-in to keep all the code in the single place.

Resume: can we use Visio as CAD replacement for wiring diagrams? Yes, it’s possible, some additional templates & code may improve usability a lot. Unfortunately MS pays not enough attention to CAD-like Visio features, paying more attention to visual enhancements. Anyway, why not to try?

You can download template, shapes and sample drawing here. Important note: it’s intended to use with Visio 2010, earlier version do not support some functions heavily used in shapes and VBA code.

UPDATE: template and sample for Visio 2013/2016 is included. Note that versions for Visio 2013/2016 unfortunately do not support switching themes. There is no any further plans to develop the library, but you can use it as a base for your own ones. All the VBA source code is included into template.

21 thoughts on “Visio Stencils Library for Wiring Diagrams

  1. I want to be part of the crowd thanking you for a fantastic stencil/template. This is awesome. 🙂
    Inspired by your template, I want to create dynamic 2D shapes of my own (with varying inputs/outputs). I am trying to teach myself how you make the these dynamics 2D shapes, but just can’t understand how. Can you please point me in the right direction to the technique used. I understand VBA well (but VBA does not seem to be part of the trick here as I do not find any code executed when I change e.g. a panel from 4 to 8 I/O’s). I also understand the ShapeSheet concept to some level, but do not immediately see how you do this. I followed your link above to “Smartshapes” on MSDN, but still could not find the solution.
    Please help……..
    Thanks in advance
    Once again, thanks for this inspiring solution.

    1. Hello Christian,
      I didn’t touch the code for a long time, but as I remember I moved all the VBA code into template. Everything else is hidden inside smart sheets: open master shape form the stencil in edit mode, then open “Master Explorer” (in Developer section), select some sub-shape and open ShapeSheet – you’ll see that some parameters depend on master sheet properties. There is no VBA code at all. “We Need To Go Deeper…”

    2. Hey Christian,

      Have you progressed much in your research? I too love this sheet template. One thing I haven’t been able to figure out is how Dmitry creates the pin and labels dynamically, seems like something that should have a script right?!

  2. Firstly, storming work here, phenominal!!

    Just wondering, is there a way to populate the component and I/O port details port from excel data? I can’t seem to figure a workable table or method to do this.

  3. Hi Dmitry, you have gone great job and I’d like to thank you very much.
    Is it possible to fill the Component stencil (variable input/output) with colour ?
    I tried to use visio fill function but it doesn’t work.
    Thank you again for your library.
    Best Regards

  4. Hello Dmitri,
    What you have done here is just amazing! This is a great great tool. I’ve been testing it for some days using Visio2016.
    Unfortunately, I found a “bug” that I don’t know how to solve.

    To create a new equipment, I copy and paste an existing equipment (master shape) and then I edit the details for each new (equipment) shape.
    However, I have a problem when editing the Component ID, the Product and rack/slot/frame positioning. If I change the data of those fields, the new shape adopts the new values fine. All seems OK, but when wiring them (using a Dynamic Conector), the dynamic conector still gets the old (from the original shape that I copied) information, although in the schema, all the data in the new shape seems to be fine.

    The position information (slot/frame/rack) also doesn’t update.

    Does anyone know what can be causing this? Any clue where to start finding the error?

    Thank you again for this work. As other users have said, I’d be happy to contribute if you set up a donation link.

    1. 1) Ensure that you enabled macros when creating new drawing from template and opening file.
      2) Save file as macros-enabled drawing (*.vsdm).
      I’ve just tested and it works in my case.

  5. Hi Dmitry,
    Thanks for your great work, this is an incredible tool. Any update on the fix for the Visio 2016 issues? As others have suggested, if you set up a donation link I’d be happy to contribute.
    Thanks again!

    1. I’ve no plans to develop it, but you can grab the sources and modify. I’ve included versions for Visio 2013/2016 without theming support – it doesn’t work well in newer versions.

  6. Hi Dmitry,

    Just wanted to follow up with you about the update to Visio 2016. Looks like I am not the only one. 🙂

    I have a copy of 2010 for this file however am running into a few issues one the drawing gets larger. It seems like the UpdateWire() routine gets stuck in an infinite loop whenever I manipulate a connector, or use any of the tools to change wire numbers or component IO. I can break the execution with CTL + BREAK but this causes issues where sometimes the data isn’t updated in the shape details. I am assuming it is only supposed to update the wires which I have changed, but I think it might be running accross the whole drawing, causing it to spin its wheels until Visio crashes.

    Thanks again for all your work, it is great!

  7. Seconding what Jay said. This is awesome, I’d even be willing to buy you lunch (paypal/amazon/google) to get a 2016 update 🙂

  8. I have started to test your solution today and seems to be a good starting point, but already usable, to a great solution.

    many thanks for sharing

  9. Doesn’t seem like the themes work with Visio 2016, I have to re-make everything black with black text if I don’t want the white on black theme.
    Also, the reports just return an error: “There was an error generating this report. The report definition is invalid”
    Your template is amazing otherwise, I’ve been looking for something like this to help with my cable schedules and wiring diagrams without having to resort to teaching myself CAD.

      1. Hey Dmitry, I’m sure you’re well aware that people love your work! and just in case you don’t – I do 🙂

        Visio 2016 is causing me a few issues though. Was there an update on this front by any chance? I’m sure if you setup a donation link, people would be happy to chip in towards helping you along!

        Thanks for your work! it’s amazing 🙂

      2. Hi Dmitry, thanks for your great work! It was a real help. Any chance for an update for Visio 2016? You saved ten of hours, any chance to let me know how to send a bottle?

    1. I had the same issue generating reports. After some testing, it appears that reports called from macros can’t have a space in the name. To get the reports working in Visio 2016, here’s what I did:

      -From the Ribbon, go to Review > Shape Reports
      -Click on ‘Equipment List’, then Modify. If you don’t see Equipment List, go back to your drawing and add a component shape.
      -Click Next 3 times until you get to the last screen where it asks to save the report definition name.
      -Remove the space in the name (either delete it or add an underscore), then click Finish.
      -Do the same thing for the Wire List report.

      -From the Ribbon, go to View > Macros
      -Click the ‘CreateEquipmentList’ macro, then click Edit
      -Change both the CreateEquipmentList and CreateWireList subs so that the part that says (“/rptDefName=EquipmentList”) matches the names you changed the reports to without the space.

      Now try to run the reports.

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s