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

How to recognize/set connections as 'straight line'

7 views
Skip to first unread message

gandalf

unread,
Dec 18, 2003, 4:31:28 AM12/18/03
to
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


Peter Suter

unread,
Dec 18, 2003, 8:34:27 AM12/18/03
to
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

--
Regards

Peter Suter
CH-3255 Rapperswil BE

(RemoveThis. from email address to contact)

Mark Nelson [MS]

unread,
Dec 18, 2003, 12:52:16 PM12/18/03
to
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.

--
Mark Nelson
Microsoft Corporation

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


"gandalf" <gan...@nomail.com> wrote in message
news:3fe173f1$0$273$4d4e...@read-nat.news.nl.uu.net...

gandalf

unread,
Dec 19, 2003, 3:26:53 AM12/19/03
to
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.

"Peter Suter" <p.sut...@WithoutThis.bluewin.ch> wrote in message
news:opr0dpbp...@news.microsoft.com...

gandalf

unread,
Dec 19, 2003, 3:33:50 AM12/19/03
to
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 ?

"Mark Nelson [MS]" <mar...@online.microsoft.com> wrote in message
news:#hBQu#YxDHA...@TK2MSFTNGP10.phx.gbl...

Peter Suter

unread,
Dec 19, 2003, 5:15:33 AM12/19/03
to
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 ;-)


On Fri, 19 Dec 2003 09:26:53 +0100, gandalf <gan...@nomail.com> wrote:

> 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.
>

Mark Nelson [MS]

unread,
Dec 19, 2003, 1:42:02 PM12/19/03
to
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.


"gandalf" <gan...@nomail.com> wrote in message

news:3fe2b7ee$0$281$4d4e...@read-nat.news.nl.uu.net...

0 new messages