How can I group the connected shapes to each other

S

shailendrasingh823

Hi All,

I want to group the connected shapes with each other,but when i drop
the shapes on page ,connect them & then use selction select all the
shape & group them the connection between shape is disconnected.

code is like that

// create a triangle shape from the stencil master collection
Visio.Shape shape1 =
currentPage.Drop(currentStencil.Masters["Triangle"], 1.50, 1.50);

// create a square shape from the stencil master
collection
Visio.Shape shape2 =
currentPage.Drop(currentStencil.Masters["Triangle"], 3, 4);

// create a dynamic connector from the stencil master
collection
Visio.Shape connector =
currentPage.Drop(currentStencil.Masters["Dynamic connector"], 4.50,
4.50);

// connect the shapes together through the dynamic
connector

ConnectShapes(shape1, shape2, connector);

window.SelectAll();

Visio.Selection selection1 = window.Selection;
selection1.DeselectAll();

selection1.Select(shape1,
(short)Microsoft.Office.Interop.Visio.
VisSelectArgs.visSelect);
selection1.Select(shape2,
(short)Microsoft.Office.Interop.Visio.
VisSelectArgs.visSelect);
selection1.Select(connector,
(short)Microsoft.Office.Interop.Visio.
VisSelectArgs.visSelect);
Visio.Shape group1 = selection1.Group();

please give me some idea .

shail
 
J

JuneTheSecond

I would like to know how did you find the shapes were disconnected.
In my test, connector does not follow the shape, when i move a sub-shape in
the group. It might be a bag, and there are other odd behavior in a group.
But these kind of behavior in a group are not modified through all versions
of visio.

Anyway you would find that the connection is not lost, when you select the
connector in the group finding that the both ends of the connector are with
red squares. If you ungroup the group, you will find the shapes are really
connected normally.
 
S

shailendrasingh823

I would like to know how did you find the shapes were disconnected.
In my test, connector does not follow the shape, when i move a sub-shape in
the group. It might be a bag, and there are other odd behavior in a group.
But these kind of behavior in a group are not modified through all versions
of visio.

Anyway you would find that the connection is not lost, when you select the
connector in the group finding that the both ends of the connector are with
red squares. If you ungroup the group, you will find the shapes are really
connected normally.

Hi June,

Thanks for ur reply. I am creating more than selections & then
grouping them.

But when I am grouping them the shapes are connected but proper
allignment is not there some shape is somewhere so.at look it's not
looking good.How can I allignment the gropups so each groups shape
shoud not intersect in another group's shape.

& also my group box geeen line size is too big,I think becsuse of this
the problem is there.

Shail
 

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