How to recognize/set connections as 'straight line'

G

gandalf

Hi,

I generate from an XML description, a set of visio pictures with a default
layout.
Then, in Visio, I beautify the layout and save the layout by reading
position, size and orientation from the corresponding shapesheet-cells.
However, I could not find out how to
1 - find out (in VBA) that a connection line has been set 'as straight
line', and
2 - generate (in VBA) the diagrams again with such a setting.

Could anybody give me some hints ?

Gandalf
 
P

Peter Suter

Hi Gandalf

I think, a straight line has one of the two conditions:
BeginX = EndX
or
BeginY = EndY.

or
The correspondent ConnectioPoints of the shapes must be on the same X or Y!

Test it!

Peter

Hi,

I generate from an XML description, a set of visio pictures with a
default
layout.
Then, in Visio, I beautify the layout and save the layout by reading
position, size and orientation from the corresponding shapesheet-cells.
However, I could not find out how to
1 - find out (in VBA) that a connection line has been set 'as straight
line', and
2 - generate (in VBA) the diagrams again with such a setting.

Could anybody give me some hints ?

Gandalf

--
Regards

Peter Suter
CH-3255 Rapperswil BE

(RemoveThis. from email address to contact)
 
M

Mark Nelson [MS]

All the details about connectors are in the Shape Layout section of the
shapesheet. The cells you want to read and write are ShapeRouteStyle and
ConLineRouteExt. These cells map to the settings in the Format > Behavior >
Connector dialog for line routing Style and Appearance.
 
G

gandalf

Hi Peter,

A straight connection is not an horizontal or vertical line, but the
shortest linebetween 2 connection points. The alternative is a curved line.
 
G

gandalf

Hi Mark,

I could not see any differences in the shapesheets for a straight and a
curved connection line.
Especially in the Shape Layout section, the value for shapeRouteStyle-cells
are the same. I did not see a ConLineRouteExt-cell.
The VBA statement
debug.print shape.Cells("Shape Layout.ShapeRouteStyle")
gives the error message 'Unexpected end of file', which means that the
section-name and.or cell-name is incorrect, so I would like to find all
valid names.
Is there a way to print out the contents of all shapesheet-cells in a
for-loop ?
 
P

Peter Suter

Hi Gandalf
Sorry, I did wrong... (In my schematc diagrams, all is horizontal or
vertical...)

Now I hope, it's correct:

To read:
MsgBox oShp.Cells("LineRouteExt").Formula
or
MsgBox oShp.Cells("LineRouteExt").ResultStr(0)
or
MsgBox oShp.CellsSRC(visSectionObject, visRowShapeLayout,
visSLOLineRouteExt).formula

To set:
oShp.CellsSRC(visSectionObject, visRowShapeLayout,
visSLOLineRouteExt).formula = visLORouteExtStraight
oShp.CellsSRC(visSectionObject, visRowShapeLayout,
visSLOLineRouteExt).formula = 1

Try it!

peter ;-)




Hi Peter,

A straight connection is not an horizontal or vertical line, but the
shortest linebetween 2 connection points. The alternative is a curved
line.




--

Regards

Peter Suter
CH-3255 Rapperswil BE
 
M

Mark Nelson [MS]

When referring to the cells by name, you should generally not include the
section name. An easy way to find the name of a cell is to go into the
Shapesheet, click on a different cell, type '=' and then click on the
desired cell. Visio will show you the proper name to use.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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