Table of contents
Collapse the table of content
Expand the table of content

Shape.DistanceFromPoint Property (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Returns the distance from a shape to a point. Read-only.


expression . DistanceFromPoint( x , y , Flags , [pvPathIndex] , [pvCurveIndex] , [pvt] )

expression A variable that represents a Shape object.


NameRequired/OptionalData TypeDescription
xRequiredDoubleAn x-coordinate.
yRequiredDoubleA y-coordinate.
FlagsRequiredIntegerFlags that influence the type of entries returned in results.
pvPathIndexOptionalVariantIdentifies the point on the shape in conjunction with pvCurveIndex and pvt.
pvCurveIndexOptionalVariantIdentifies the point on the shape in conjunction with pvPathIndex and pvt.
pvtOptionalVariantIdentifies the point on the shape in conjunction with pvPathIndex and pvCurveIndex.

Return Value



The ( x,y) point is expressed in internal drawing units (inches in the drawing) with respect to the coordinate space defined by the sheet immediately containing ThisShape.

The pvPathIndex, pvCurveIndex, and pvt arguments optionally return values that identify the point the returned distance is measured from. Call that point ( xOnThis,yOnThis). It lies along the c'th curve of ThisShape's p'th path and can be determined by:

ThisShape.Paths(*pvPathIndex).Item(*pvCurveIndex).Point(*pvt,&;xOnThis ,&;yOnthis)

You can use the PointAndDerivatives method instead of the Point method if you want to find the first and second derivatives at position t along the curve.

If pvPathIndex or pvCurveIndex is not Null , an Integer (type VT_I4) is returned. If pvt isn't Null , DistanceFromPoint returns a Double (type VT_R8).

The DistanceFromPoint property considers guides to have extent and considers a shape's filled areas and paths.

The Flags argument can be any combination of the values of the constants defined in the following table. These constants are also defined in VisSpatialRelationFlags in the Microsoft Visio type library.

**Constant ****Value ****Description **
visSpatialIncludeDataGraphics&;H40Includes data graphic callout shapes and their sub-shapes. By default, data graphic callout shapes and their subshapes are not included. If the parent shape is itself a data graphic callout, searches are made between the parent shape's geometry and non-callout shapes, unless this flag is set.
visSpatialIncludeHidden&;H10Consider hidden Geometry sections. By default, hidden Geometry sections do not influence the result.
visSpatialIgnoreVisible&;H20Do not consider visible Geometry sections. By default, visible Geometry sections influence the result.

Use the NoShow cell to determine whether a Geometry section is hidden or visible. Hidden Geometry sections have a value of TRUE and visible Geometry sections have a value of FALSE in the NoShow cell.

If the parent object has no geometry, or if Flags excludes consideration of all geometry, the DistanceFromPoint property returns a large number (1E+30) which should be interpreted as infinite.

The DistanceFromPoint property does not consider the width of a shape's line, shadows, line ends, control points, or connection points when computing its result.

© 2018 Microsoft