DrawPolyline method

Microsoft Visio Developer Reference

DrawPolyline method

       

Creates a new shape whose path is a polyline along a given set of points.

Version added

2000

Syntax

objRet = object.DrawPolyline(xyArray, flags)

objRet

A Shape object that represents the new polyline.

object

Required. An expression that returns a Page, Master, or Shape object in which to draw the shape.

xyArray

Required Double. An array of alternating x and y values that defines points in the new shape's path.

flags

Required Integer. Flags that influence how the shape is drawn.

Remarks

The DrawPolyline method creates a new shape whose path consists of a sequence of line segments and whose end points match the points specified in xyArray. Calling the DrawPolyline method is equivalent to calling the DrawSpline method with a tolerance of zero (0) and a flag of visSplineAbrupt.

The control points should be in internal drawing units (inches) with respect to the coordinate space of the page, master, or group where the shape is being dropped. The passed array should be a type SAFEARRAY of 8-byte floating point values passed by reference (VT_R8|VT_ARRAY|VT_BYREF). This is how Microsoft Visual Basic passes arrays to Automation objects.

The flags argument is a bit mask that specifies options for drawing the new shape. Its value can include visPolyline1D (8) or visPolyarcs (256). If flags includes

  • visPolyline1D and if the first and last points in xyArray don't coincide, the DrawPolyline method produces a shape with one-dimensional (1-D) behavior; otherwise, it produces a shape with two-dimensional (2-D) behavior.
  • visPolyarcs, then Visio will produce a sequence of arcs rather than a sequence of line segments; xyArray should specify the initial x,y point of the sequence followed by x,y bow triples. Visio will produce a shape with EllipticalArcTo rows where the bow of the arc matches the specified value.

If the first and last points in xyArray coincide, the DrawPolyline method produces a filled shape.