Inappropriate Source Object for this Action(Error)

  • Thread starter shailendrasingh823
  • Start date
S

shailendrasingh823

Hi All ,

I am trying to two shapes with defferent connectors (exp Dynamic
Connector & Logical Connector) depends upon user database to create
the shape & connection shape.

I am getting following error "Inappropriate Source Object for this
Action(Error)"

When I am executing following code

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);
}
}

Here GlueTo method is working for Dynamic Connectors fine but for
logical connector it's giving me error.

connection shape by reading connection table datacolumn which has
string "Dynaminc" or "Logical" depends this I am selecting connector
type.

Thanks
Shail
 
B

Barb Way

The DB model is a closed solution, and does not have a public API. In
order to maintain consistency in the solution, there are various actions
which are blocked or controlled in code. The connector, which represents a
Relationship, is one of those managed objects, and we do not support
changing the native behavior of the solution in this manner.

Barb Way
Product Support - Visio
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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