S
shailendrasingh823
Hi There,
I have more than 1 type connector including dynamic connector for
different conditions.like decide the connection type from a database
field( expmic or Logical).
GlueTo method is givinf me this exception " Imappopriate Source object
for this Action" when I try to execute
this 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);
object obj = shapeCell.GetType();
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);}
It's working for Dynamic Connector Shape instance but for Logical
Connector shape instance
It's giving me that message "Imappopriate Source object for this
Action ";
Please share if any idea.
Regards
Shail
I have more than 1 type connector including dynamic connector for
different conditions.like decide the connection type from a database
field( expmic or Logical).
GlueTo method is givinf me this exception " Imappopriate Source object
for this Action" when I try to execute
this 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);
object obj = shapeCell.GetType();
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);}
It's working for Dynamic Connector Shape instance but for Logical
Connector shape instance
It's giving me that message "Imappopriate Source object for this
Action ";
Please share if any idea.
Regards
Shail