Re-Layout Connectors automatically

L

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

David J Parker [MVP Visio]

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

Eric Hudon

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.
 

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