Visio Automation To Lookup Shapes

Started by jshiangoli, October 29, 2009, 12:05:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jshiangoli

Hi All,
Please may I have your advice on the following?
I'm putting together a script to create a Visio Drawing Automatically based on a discovered network topology. From my network topology data I know what is connected and the type of nodes that are connected for example servers, laptops, workstations, switches, routers etc.
Without prior knowledge of the visio stencils and their shapes i need to be able to locate the best visio shape for a given node type. Acheiving a close match between the visio shape name and the node type.
Programatically you 1st need to open the stencil (OpenEx) before you can retrieve the shape (get_itemU). Hence the challenge here is is which stencil do i use?
To acheive this I thought that the best way would be to create a database table that has column `visio stencil` and `visio shape`. However how do i populate such a table from a visio installation?

Any advice on the best way to acheive this would be greatly appreciated

Regards
John

aledlund

John,
Great question!
First here's a pointer that might give you some ideas on some data schema's

http://msdn.microsoft.com/en-us/library/aa140345(office.10).aspx#visautdisc_topic2

This was the original schema for when the Visio Enterprise Network Tool was still available. It was a network discovery tool that IMHO hasn't been matched since. There was a second piece of the puzzle that was also distributed. It was the product stencils created by Altima Technologies (http://www.netzoom.net/home/index.php). The way these two tools worked together was the VENT tool would perform the discovery using SNMP (which provided a vendor unique SysObjectId for discoverable components) and then do a table lookup (it had MS Access redistributable with it) that cross-referenced into the stencils/masters.  I was unable to find any reference on the Altima site to see if they still provide the SysObjectId data associated with the shapes they create, they are not for free... There current process of including environmentals for the shapes is looking very good.
The world has grown some since then with requirements for (in some cases) three views for components; top, rear, and front. In my experience I usually discover (manually) a few hundred different component types when surveying a data center (both active and passive), so SNMP isn't a standalone/single solution. The table I store the data in obviously has vendor information, some environmentals, the visio master/stencil data, and error flags for when the visio data is validated.


This might give you some other ideas also
http://www.youtube.com/watch?v=oVMpOKmsZVQ

HTH
al

jshiangoli

Hi Al,
Thankyou for taking the time to reply to my post. Perhaps I've not explained the challenge that I have?
1st and foremost the network discovery from whichever tool used has already been done. I have a database which could be MySQL, excel.....whatever it doesn't matter, that is populated with devices, device addresses and device types as well as their connections.
In fact for the sake of clarity it might be best we ignore that its a network diagram.
Lets say I have text that describes an object. I want to in turn find the best matched visio shape that I have in my 'visio' installation that matches this text. With regards to text matching I have the means to acheive this using various lookup methods such as SOUNDEX or other algorithms, this I can do. What I'm stuck on is what is the best way to lookup shapes from a visio installation to match the text i have to a shape as well as establish the visio stencil. Ideally it would be great to import this information into a datasource as I described in my original post.

Regards
John

aledlund

The brute force approach would be to write a routine to recurse through the system looking for .VSS files (stencils) and then recurse through the stencil capturing master names. (since there is no guarantee that the  'visio installation' is aware of the shapes you want)
You would then have a seeded list of shapes on the system and where they are at. You certainly wouldn't want to do this too often.
You then have the fun of reviewing them manually to see which are appropriate for what you are trying to accomplish. The need for table 'key' is obvious, you might consider adding a field for 'keywords' that you could index on (sql text search).
Hopefully this would assist in the "best matched visio shape" since that is a pretty subjective target.
Any other attributes of course are specific to your solution.

wapperdude

#4
There is a utility that Paul Herber offers, which is similar to the Stencil Report Wizard add-on that is no longer available, which might be useful.  You can find his utilities here, and I believe his stencil report function is available for free: http://www.sandrila.co.uk/visio-utilities/.

Wapperdude
Visio 2019 Pro

slaybells

jshiangoli,

Did you get any further with this?  I too am interested in making a network diagram from imported shape data.  My actual issue is the detail of graphic placement on the screen, eg server box between VLAN lines.  Did you succeed in this?

cheers
Slaybells

vojo

I too am interested in this.   I bit of a similar thread...but is similar to this discussion.

Even some sort of "tool" or add on that presents all the visio files on a drive or even better...pages (index, list of files, etc)
Ie similar to "open stencil" where the list of pages listed (after running some sort of index - even user initiated)
actual page pictures or some metadata at least at the file level (could say "for tool to be productive, need metadata on say background 1 or xml info or or or)

text of the following.
             visio_diagram_1:page 1
             visio_diagram_2: my_cool
             etc.

The can select it (even if selecting desired page opens up entire file)

Ie....could be viewed as a "visual filesystem" kind of thing.

Where I am coming from is the following:   I have lots of diagrams for various threads of activity (this customer engagement, that new arch, etc) where
the drawings evolve over time.   So I many end up with "cool_stuff v1.vsd" thru "cool_stuff v9.vsd" because of refinement/feedback/whatever.
now periodically, these threads are very similar...so something "cool_stuff vx.vsd" might be very similar/useful for "hot_stuff vx.vsd" I am developing
So its a pain to walk thru all the files based on my memory (wait...what was I talking about   :D  )....especially if its a few months back.

so something along the lines you are talking about would be helpful to me at least.
I realize it would involve some pretty heavy lifting...ie could get into  some sort of poor mans DB to manage....but would be helpful