Page.DrawPolyline Method
Visio Automation Reference |
Creates a shape whose path is a polyline along a given set of points.
Version Information
Version Added: Visio 2000
Syntax
expression.DrawPolyline(xyArray(), Flags)
expression A variable that represents a Page object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
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. |
Return Value
Shape
Remarks
The DrawPolyline method creates a new shape whose path consists of a sequence of line segments and whose endpoints 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 in which the new shape is being created. 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 bitmask 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, Microsoft Office 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.
Example
The following example shows how to draw two polyline shapes that have 2-D and 1-D behavior, respectively, on the active page.
Visual Basic for Applications |
---|
|
See Also