T
Tamir Khason
Following the function to fetch shape clicked.
This works fine on shapes like Computer/Box etc. however this does not work
on Connectors. It return zero size selection while clicking on connector,
inspite the connector is shape as well. Why and how to catch click on
connector???
TNX
public static Visio.Shape GetClickedShape( Visio.Page visioPage, double x,
double y,double tolerance )
{
try
{
Visio.Selection visSelection = visioPage.get_SpatialSearch(x,y,
(short) Visio.VisSpatialRelationCodes.visSpatialContainedIn,
tolerance,
(short) Visio.VisSpatialRelationFlags.visSpatialFrontToBack);
Console.WriteLine("Selection is {0} size", visSelection.Count);
if (visSelection.Count > 0 )
{
Console.WriteLine( visSelection[1].Name);
return (Visio.Shape) visSelection[1];
}
else
{
return null;
}
}
catch( Exception exp)
{
Console.WriteLine( exp.Message );
throw exp;
}
}
This works fine on shapes like Computer/Box etc. however this does not work
on Connectors. It return zero size selection while clicking on connector,
inspite the connector is shape as well. Why and how to catch click on
connector???
TNX
public static Visio.Shape GetClickedShape( Visio.Page visioPage, double x,
double y,double tolerance )
{
try
{
Visio.Selection visSelection = visioPage.get_SpatialSearch(x,y,
(short) Visio.VisSpatialRelationCodes.visSpatialContainedIn,
tolerance,
(short) Visio.VisSpatialRelationFlags.visSpatialFrontToBack);
Console.WriteLine("Selection is {0} size", visSelection.Count);
if (visSelection.Count > 0 )
{
Console.WriteLine( visSelection[1].Name);
return (Visio.Shape) visSelection[1];
}
else
{
return null;
}
}
catch( Exception exp)
{
Console.WriteLine( exp.Message );
throw exp;
}
}