Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Create connection shape and database export

7 views
Skip to first unread message

nmb

unread,
Nov 24, 2004, 7:44:06 AM11/24/04
to
Hello there.

I'm tryin' to create a stencil with two shapes:

A) normal shape with some custom properties
B) connection between two A)'s

These shapes have to be exported to diferent tables in a database.

Something like this:

A)
-ID
-Prop1
-Prop2
-(...)

B)
-ID1
-ID2

My problem resides in getting (in a dynamic way) the two ID's of the
shapes that a B) is connecting.

How can I (dynamically) get that information and store it in a way
that's easy to export to a database?

Chris Roth [ Visio MVP ]

unread,
Nov 26, 2004, 9:22:03 AM11/26/04
to
If I had any brains, I'd package up this code and post it on the web,
because the method for doing this is, shall we say, a bit too elemental.

You have to look at "Connects" objects, which have information as to which
shape is glued to which shape, and at which cell the connection takes place.
Quite detailed, but scary if you're newer to Visio.

You've got two concepts. Find all the "A" shapes on the page, then query
each shape's FromConnects collection. This will give you information as to
which "B" shapes are connected to it.

Now that you have a "B" shape, you have to find who's on the other end (if
anyone). "B" shapes are connectors, and they have a Connects class - similar
to a FromConnects. Now you can find the "A" at the other end.

So it's probably more efficient, code-wise, to just look at all the
connectors - just the "B" shapes and find out who's on each end.
Unfortunately,a s humans, we tend to think "which box is connected to which
other box". But in Visio it's all about the little red handles on the end of
the connectors. Those represent connects objects, and they're easier to find
if you look at the connectors.

You can also get the Connects collection for an entire page.

Bottom line: Visio Developer Reference (help file), key words:

FromConnects, ToConnects,
FromSheet, ToSheet,
FromCell, ToCell.

--

Hope this helps,

Chris Roth
Visio MVP


"nmb" <nunoba...@yahoo.com> wrote in message
news:c128d1ef.04112...@posting.google.com...

0 new messages