Take a look at this simple Visio diagram
What separates it from every other document I’ve shown you? it was generated on a machine that didn’t even have Visio 2007 installed.
About a year ago in the middle of my work on VisioAutomation I had written some code to generate VDX files by directly creating XML instead of automating Visio. At the time my goal was to create an ASPX page that could generate Visio charts on demand.
This mostly worked (for simple diagrams) but had one core limitation – it still required someone to have the Visio Primary Interop Assembly. With the latest code, now there is no connection at all to the PIA – I could, for example, use this code with Mono running on Ubuntu to generate the same file.
I’ll be creating a new CodePlex project with the source code shortly. Keep in mind just a few things. First, it isn’t magic – it still requires someone to have an understanding of Visio’s shapesheet concept. Second, a lot of the layout smarts have to be replicated – so for example if you want to automatically layout charts you’ll have to use something like MSAGL or GraphViz to place things. Third, to generate the output VDX it requires an input VDX (this is where it gets masters from).
As a preview, here’s a screenshot of the code from one of my unit tests. You should get a good idea of how this library works from the example below.