Connecting Shapes Automatically

B

BenMcD

Hi Everyone,

I'm trying to get Visio to connect shapes automatically. The process should
be that Visio examines the 'Connected to' field of the shape, locates the
shapes in the drawing listed in this field using their Asset Number, then
draws connecting lines between the shape and it's children. So for example,
it would look at a Switch, recognise that 3 servers are connected to it,
locate these servers on the drawing, then add the connectors.

Does anyone have any ideas how this could be done? I'm thinking it's going
to be a bit of VBA, but my knowledge is limited. My eventual plan is to run a
database update, add the new shapes based on the Access records, then
automatically link and layout the shapes to produce a Network Toplogy diagram.

I'm sure it's possible, but I need advice from experts to help me out!

Thanks in advance,
Ben
 
A

Al Edlund

The easy first step is to get David Parkers book on data visualization. He
has some examples on how to do the visio portion of it. The pre-req in this
case if v2007 Pro for data linking. I usually strongly suggest that the user
consider using o2007 pro as well even though a2007 isn't required. The
skill set would be medium to strong vb(a) skills with some knowledge of
database.
If you need more help come on back,

al
 
B

BenMcD

Thanks for that Al, I'll do some googling and try and order a copy of the
book. Can this be done in any version of 2003? My organisation doesn't have
2007 at the moment, but I can get a copy of it if it can't be done in 2003.
 
D

David Parker

The book is aimed at Visio 2007, but roughly half is applicable to Visio
2003.
The connections example could be adapted to read any recordset, or the
custom properties (which could be refreshed using the database wizard)
 
B

BenMcD

Sounds like exactly what I need! Just to make it clear:

Each of the component items within my DB are related to different service
areas within my organisation. I could use the database wizard to monitor the
table and add the shapes automatically, copying the record details into the
relevant custom property fields. Within a new custom property, each item
would have the asset tag of the other equipment it's linked to- could Visio
monitor this field, identify the asset tag of the related items, find the
related items, and draw the links between them?

Hopefully then it would be a case of setting Visio to auto-arrange the
shapes into a tree based layout.

Does this sound 'do-able'?
 
D

David Parker

Yes, with code, of course

BenMcD said:
Sounds like exactly what I need! Just to make it clear:

Each of the component items within my DB are related to different service
areas within my organisation. I could use the database wizard to monitor
the
table and add the shapes automatically, copying the record details into
the
relevant custom property fields. Within a new custom property, each item
would have the asset tag of the other equipment it's linked to- could
Visio
monitor this field, identify the asset tag of the related items, find the
related items, and draw the links between them?

Hopefully then it would be a case of setting Visio to auto-arrange the
shapes into a tree based layout.

Does this sound 'do-able'?
 
B

BenMcD

David,

I've bought your book and have been working my way through it. Very good
read, there's so much I didn't realise you could do with Visio!

I've started coding to get the shapes to link automatically, I'm modifying
the 'Connect my Subordinates' section to suit my needs. When I run it in it's
standard form, it displays the following error:

"Compile Error:
Type mismatch: array or user-defined type expected"

The particular line is:
If FindMySubordinates(manager, foundShapes) = True Then

I'm not too sure where to go from here, any suggestions?

Thank you,
Ben
 
B

BenMcD

No problems, I've sorted it now.

I've managed to get it linking the shapes, I'm now working on getting it to
link to more than one parent, by examining the list from the field, for
example:

"51425487, 58694875"

Hoping this is possible!
 
B

BenMcD

True, but the book is just fine in plain black and white to be honest, simple
and easy to read that way!

Unforunately I'm back to ask your advice again- I've cracked getting Visio
to link shapes. It looks at the particular shape, examines a field called
'Parent', takes the name of the parent, locates it then connects the two
together. I can't seem to work out how to get it to connect a shape to
mutliple parents!

My parent field would be as follows:
Parent - SERVER1, SERVER 2, SERVER3

Each entity is followed by a comma and seperated by a space. How do I go
about modifying the code so that it can connect to multiple parents? I can
send the code if required?

Any advice/help you can provide would be greatly appreciated as I've been
struggling for some time!

Thanks again,
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top