Using Logical Connector rather than Dynamic(giving m error)

  • Thread starter shailendrasingh823
  • Start date
S

shailendrasingh823

Hi There,

I am trying to use Logical Connector rather than Dynamic Connector,

I have written function

private static void glueConnectionToItems(
Visio.Page drawingPage,
Visio.Shape connectionShape,
int fromShapeIndex,
int toShapeIndex)
{
try
{
// Glue the beginning of the connection to the "From"
shape.
Visio.Cell shapeCell =
drawingPage.Shapes[fromShapeIndex].get_CellsSRC(
(short)Visio.VisSectionIndices.visSectionObject,
(short)Visio.VisRowIndices.visRowXFormOut,
(short)Visio.VisCellIndices.visXFormPinX);
Visio.Cell connectorCell =
connectionShape.get_CellsSRC(
(short)Visio.VisSectionIndices.visSectionObject,
(short)Visio.VisRowIndices.visRowXForm1D,
(short)Visio.VisCellIndices.vis1DBeginX);
connectorCell.GlueTo(shapeCell);

// Glue the end of the connection to the "To" shape.
shapeCell =
drawingPage.Shapes[toShapeIndex].get_CellsSRC(
(short)Visio.VisSectionIndices.visSectionObject,
(short)Visio.VisRowIndices.visRowXFormOut,
(short)Visio.VisCellIndices.visXFormPinX);
connectorCell =
connectionShape.get_CellsSRC(
(short)Visio.VisSectionIndices.visSectionObject,
(short)Visio.VisRowIndices.visRowXForm1D,
(short)Visio.VisCellIndices.vis1DEndX);
connectorCell.GlueTo(shapeCell);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

it's working fine for Dynami Connection but for logical connection
when I am passing Shape & try to grt its cells
giving me "Inappropriate source object for this action" when
calling
Visio.Cell connectorCell = connectionShape.get_CellsSRC(..).

Thanks
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