Shape.HitTest Method (Visio)
Determines if a given x,y position hits outside, inside, or on the boundary of a shape.
expression .HitTest(xPos, yPos, Tolerance)
expression A variable that represents a Shape object.
The x-coordinate to be tested for a hit.
The y-coordinate to be tested for a hit.
How close xPos,yPos must be to a shape for a hit to occur.
The HitTest method considers only visible geometry and ignores hidden geometry.
Use internal drawing units (inches in the drawing) for the xPos, yPos, and Tolerance values. These values should also be in, and with respect to, the coordinate space of the page, master, or group shape that contains the shape being hit tested.
The following are possible values returned by the HitTest method, and are declared by the Visio type library in VisHitTestResults .
Data graphic callout shapes (and their sub-shapes) that are applied to the parent shape are excluded from hit-test calculations. If the parent shape is itself a data graphic callout shape, its geometry (and that of its sub-shapes) is not excluded from hit-test calculations.