Discussion:
Inappropriate Source Object for this Action(Error)
(too old to reply)
s***@gmail.com
2007-11-06 13:35:20 UTC
Permalink
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
Barb Way
2008-02-08 19:21:45 UTC
Permalink
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.
Continue reading on narkive:
Loading...