Connecting 2 Shapes with a Line

M

Manfred

Hello Community,

I want to use the GlueTo Method to connect 2 Shapes with a line. But it's
just working with one side. Could somebody tell where my mistake could be or
send me a democode? One of this Shapes is a group shape that contains two
other shapes in order to have 2 text fields. Could this be a problem?
However, i want to connect the right pin of shape 1 with the left pin of
shape 2.
Please help me, i have no idea left.

Greetings
 
M

Manfred

Ok,

i try to describe my problem. I have two shapes one normal one and a
groupshape. I handled the glueto problem like this:

Shape normalshape;
Shape groupshape;
Shape connector;

Cell Cell1 = connector.getCellsU("BeginX");
Cell Cell2 = normalshape.getCellSRC(7,3,0);
Cell1.glueto(Cell2);

Cell Cell3 = connector.getCellsU("EndX");
Cell Cell4 = groupshape.Shapes[1].getCellSRC(7,2,0); // because
groupshape.getCellSRC(7,2,0) isn't working
Cell3.glueto(Cell4);

Is this ok? Because i get a problem with my getconnectedShapes function. The
function can't get the groupshape. The function looks like this:

public void getConnectedShapes(Visio.Shape sh,out ArrayList al_prev,out
ArrayList al_next)
{
al_prev= new ArrayList();
al_next = new ArrayList();

for (int i=1;i-1 < sh.FromConnects.Count;i++)
{
Visio.Shape connector= sh.FromConnects.FromSheet;
for (int j = 1; j - 1 < connector.Connects.Count; j++)
{
if (sh != connector.Connects[j].ToSheet)
{
switch (connector.Connects[j].FromPart)
{
case 9:
{
al_prev.Add(connector.Connects[j].ToSheet);
break;
}
case 12:
{
al_next.Add(connector.Connects[j].ToSheet);
break;
}
}
}
}
}
// return al;
}

Could you find my mistake?

Greetings
 
J

JuneTheSecond

I cannot see, but try ContainingShape property to get parent shape in your
function.
 

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