views:

22

answers:

2

We already have several (100+ pages) of drawings in the same format that describe interconnecting systems. Instead of pounding keys for 3 months transferring these relationships to a spreadsheet, I would like to parse the Visio drawings directly.

Is there a library dedicated to Visio that would accomplish this? Am I just missing something extremely obvious?

+3  A: 

You need the Visio Object Model.

This object model consists of classes and interfaces that are provided in the primary interop assembly for Visio, and are defined in the Microsoft.Office.Interop.Visio namespace.

Unfortunately the only documentation appears to be for VBA, but this should get you going.

Steve Townsend
A: 

Have a look at the About the Visio Managed Code Interop Tutorial to get started. For your purpose can probably ignore Lesson 2: Event Handling. Then all the information in the Visio Object Model link Steve Townsend posted will help you in parsing the document. In particular you should look at the APIs related to connections between shapes, start at the Connect Object.

There is an alternative to using Visio Automation to parse the documents if you have the documents saved as VDX instead of VSD files. VDX files XML files so you could read them without using Visio. See An XML for Visio overview

Pat Leahy