How to control the ruoting of a connection

A

Aussie Susan

Environment: Visio 2003 using VBA and shapesheet formulae.

I am creating a drawing of an acyclic graph that I have already processed so
as to (at least try to!!!) minimise the crossings of the connections between
the various nodes and I have determined the X/Y placement of all of the
shapes.

I want to connect to shapes together but in a few cases the connection is
not a single straight line. I have already determined the mid-points where
the line is to pass through as well as the connection points on the two
shapes.

Because I want the connection to move with the shapes (if they are later
manually moved by the user) I have used a dynamic connector and glued the
ends to the shapes. However, I can't seem to find a way of defining the
intermediate routing points: whatever I try seems to be over-written by Visio
(presumably because of the gluing process).

I have tried to create a connector manually and I can use the various
keyboard buttons and move movements to create the connector with the required
characteristics and I can insert the mid-points positioned to where I want
them to be. However, when I have recorded a macro of this, and tried to do
something similar myself, I cannot end up with the same result. (The macro
does not seem to modify the number of rows in the Geometry1 shapesheet cells
but does indicate that the cell values can be written to. When I try this the
number of lines in the Geometry section seems to increase with each value I
set and sets the other (Y or X) value to 0!)

I have tried to create a line with the appropriate mid points, but as soon
as I glue the ends to the shapes, Visio re-calculates the line and looses all
of the mid-point information.

I am not tied to any particular type of connection, so I am interested in
finding out what I need to do and in what order to achieve the required
outcome.

Thanks

Susan
 
A

Andy

You can turn the Visio rerouting off for each of the dynamic connector
shapes. I think you can turn this off for your entire diagram,
although this escapes me at the moment. I'm not sure what you want to
happen if your connected shapes are subsequently moved by the user,
will you recalculate your intermediate points.

connectorShape .CellsSRC( _
visSectionObject, _
visRowShapeLayout, _
visSLOConFixedCode).FormulaU =
visSLOConFixedRerouteNever
 
A

Aussie Susan

Thanks Andy,

This certainly was part of the solution. However, I still could not control
the places where the 'mid-points' of the lines were to be placed because I
could not insert rows into the Geometry1 section.

Therefore I ended up using a simple line and then modifying everything to my
needs. The glue from the line ends to the two connected shapes still works
and the first and last line segments adjust when the shapes are moved - the
'middle' line segments just sit there and don't seem to respond to anything.
Still, this is better than nothing and will do for now.

Thanks

Susan
 
A

Aussie Susan

Al,

I used something like the dummy shape approach to generated the 'mid points'
in the first place. I created dummy shapes which I included in the overall
layout algorithm and moved around accordingly.

I was trying to draw out the result by not displaying the 'dummy' shapes but
using the locations to generate the mid points of the 'real' connections.

I'll check out the blog reference.

Thanks

Susan
 

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