How do I Group two shapes

G

Gamini Jayarathne

I am writing an Add-in with onConnection function to add various events to
fire. In this case I need to get the event when a particular shape is
dropped on an existing shape on the document. And also if the two shapes are
overlapped, I need to group them programmatically. How do I do this?
If someone can give me a sample code it is great. I am writing this in C#.
Even VB is ok, so that I can convert.
Please help me

Tx
Gamini
 
M

Markus Breugst

Hello Gamini,

here's some example code that groups two shapes.

IVApplication visioApplication = ...;
IVShape shape1 = ...;
IVShape shape2 = ...;
IVSelection selection = visioApplication.ActiveWindow.Selection;

selection.DeselectAll();
selection.Select( shape1, VisSelectArgs.visSelect );
selection.Select( shape2, VisSelectArgs.visSelect );
selection.Group();

Best regards,
Markus
 

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