Discussion:
Re-Layout Connectors automatically
(too old to reply)
Lucas
2009-08-12 15:04:01 UTC
Permalink
Hi!

I'm creating a Visio VDX-File outside of Visio. I get a problem when trying
to connect two shapes with a "Dynamic Connector. For example, if I want to
connect shape 1 and 2, I would create an XML-Entry like this:

<Shape ID='3' NameU='Dynamic connector' Type='Shape' Master='3'>
<Geom IX='0'>
<MoveTo IX='1'></MoveTo>
<LineTo IX='2'></LineTo>
</Geom>
</Shape>

What happens when I open the resulting file in Visio is that the connector
appears somewhere on my page, but not connecting the shapes. As soon as I
move one of the shapes, the connector "jumps" and is automatically glued to
the specified shapes.

How can I achieve that the connector is automatically glued to the specified
shapes without needing to move the shapes manually first?

Cheers,
Lucas
Eric Hudon
2009-09-28 15:03:01 UTC
Permalink
I have the same exact issue. Any answers are welcomed.
Post by Lucas
Hi!
I'm creating a Visio VDX-File outside of Visio. I get a problem when trying
to connect two shapes with a "Dynamic Connector. For example, if I want to
<Shape ID='3' NameU='Dynamic connector' Type='Shape' Master='3'>
<Geom IX='0'>
<MoveTo IX='1'></MoveTo>
<LineTo IX='2'></LineTo>
</Geom>
</Shape>
What happens when I open the resulting file in Visio is that the connector
appears somewhere on my page, but not connecting the shapes. As soon as I
move one of the shapes, the connector "jumps" and is automatically glued to
the specified shapes.
How can I achieve that the connector is automatically glued to the specified
shapes without needing to move the shapes manually first?
Cheers,
Lucas
David J Parker [MVP Visio]
2009-09-28 21:33:10 UTC
Permalink
Have you forgotten (or didn't know) that you need to have entries in the
Page/Connects ?
e.g:
<Connects>
<Connect FromSheet='3' FromCell='BeginX' FromPart='9' ToSheet='1'
ToCell='PinX' ToPart='3'/>
<Connect FromSheet='3' FromCell='EndX' FromPart='12' ToSheet='2'
ToCell='PinX' ToPart='3'/>
</Connects>
</Page>


Also, the Geom section may need actual values for the line, e.g.:

<Geom IX='0'>
<NoFill>1</NoFill>
<NoLine>0</NoLine>
<NoShow>0</NoShow>
<NoSnap>0</NoSnap>
<MoveTo IX='1'>
<X>0</X>
<Y>0</Y>
</MoveTo>
<LineTo IX='2'>
<X>0</X>
<Y>-2.36220472440945</Y>
</LineTo>
<LineTo IX='3'>
<X>2.519685039370079</X>
<Y>-2.36220472440945</Y>
</LineTo>
</Geom>
Post by Eric Hudon
I have the same exact issue. Any answers are welcomed.
Post by Lucas
Hi!
I'm creating a Visio VDX-File outside of Visio. I get a problem when trying
to connect two shapes with a "Dynamic Connector. For example, if I want to
<Shape ID='3' NameU='Dynamic connector' Type='Shape' Master='3'>
<Geom IX='0'>
<MoveTo IX='1'></MoveTo>
<LineTo IX='2'></LineTo>
</Geom>
</Shape>
What happens when I open the resulting file in Visio is that the connector
appears somewhere on my page, but not connecting the shapes. As soon as I
move one of the shapes, the connector "jumps" and is automatically glued to
the specified shapes.
How can I achieve that the connector is automatically glued to the specified
shapes without needing to move the shapes manually first?
Cheers,
Lucas
Eric Hudon
2009-09-28 22:01:01 UTC
Permalink
I did know and did not formet about the Connects. ;)

I was able to solve my problem by marking the first goem as delete. Like this:

<Geom IX="0" Del="1">

</Geom>

Then I replaced it with my own Goem IX="0". That way now I am able to
manually route my link. Also I did have to use some DEPENDSON so Visio loads
my sparse xml file properly.


Simply have that statement:

<Shape ID='3' NameU='Dynamic connector' Type='Shape' Master='3'>
<Geom IX='0'>
<MoveTo IX='1'></MoveTo>
<LineTo IX='2'></LineTo>
</Geom>
</Shape>

Actually appends to list of row in the first Goem instead of overriding it.
Post by David J Parker [MVP Visio]
Have you forgotten (or didn't know) that you need to have entries in the
Page/Connects ?
<Connects>
<Connect FromSheet='3' FromCell='BeginX' FromPart='9' ToSheet='1'
ToCell='PinX' ToPart='3'/>
<Connect FromSheet='3' FromCell='EndX' FromPart='12' ToSheet='2'
ToCell='PinX' ToPart='3'/>
</Connects>
</Page>
<Geom IX='0'>
<NoFill>1</NoFill>
<NoLine>0</NoLine>
<NoShow>0</NoShow>
<NoSnap>0</NoSnap>
<MoveTo IX='1'>
<X>0</X>
<Y>0</Y>
</MoveTo>
<LineTo IX='2'>
<X>0</X>
<Y>-2.36220472440945</Y>
</LineTo>
<LineTo IX='3'>
<X>2.519685039370079</X>
<Y>-2.36220472440945</Y>
</LineTo>
</Geom>
Post by Eric Hudon
I have the same exact issue. Any answers are welcomed.
Post by Lucas
Hi!
I'm creating a Visio VDX-File outside of Visio. I get a problem when trying
to connect two shapes with a "Dynamic Connector. For example, if I want to
<Shape ID='3' NameU='Dynamic connector' Type='Shape' Master='3'>
<Geom IX='0'>
<MoveTo IX='1'></MoveTo>
<LineTo IX='2'></LineTo>
</Geom>
</Shape>
What happens when I open the resulting file in Visio is that the connector
appears somewhere on my page, but not connecting the shapes. As soon as I
move one of the shapes, the connector "jumps" and is automatically glued to
the specified shapes.
How can I achieve that the connector is automatically glued to the specified
shapes without needing to move the shapes manually first?
Cheers,
Lucas
Loading...