Share via


HitTest Method [Visio 2003 SDK Documentation]

Determines if a given x,y position hits outside, inside, or on the boundary of a shape.

intRet = object**.HitTest**(x, y, tolerance)

intRet     Integer. Any combination of the values of the constants prefixed by visHit. See Remarks.

object     Required. An expression that returns a Shape object.

x     Required Double. The x-coordinate to be tested for a hit.

y     Required Double. The y-coordinate to be tested for a hit.

tolerance     Required Double. How close x,y must be to a shape for a hit to occur.

Version added

4.5

Remarks

The HitTest method considers only visible geometry and ignores hidden geometry.

Use internal drawing units (inches in the drawing) for the x, y , 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 of intRet, and are declared by the Visio type library in VisHitTestResults.

Constant Value

visHitOutside

0

visHitOnBoundary

1

visHitInside

2

Applies to | Shape object

See Also | BoundingBox method