AddPolyline

AddPolyline has been superceded by AddPolyline2. AddPolyline adds a new polyline shape. Returns a Polyline object. Please consider using the more recent version, AddPolyline2. AddPolyline has been retained for backward compatibility.

Syntax

object. AddPolyline( Vertices )

Parameter

Type

Required/

Optional

Default

Description

Vertices

Array of Doubles

required

A polyline is a collection of one or more connected line segments. The Vertices parameter provides the start point and end points of different line segments. End point of the first line segment is the start point for the next line segment and so on.

Remarks

Use page units in the array. Vertices is an array containing alternating x,y page coordinates. This assumes the entire array is used. VB users can use

Example 1

This example demonstrates how to create a polyline using an array of doubles named Coordinates. The even numbered elements within the Coordinates array represent x values, while the odd numbered elements represent their corresponding y values. The following code snippet would create a polyline joining points (4,1), (7,3) and (2,6).

Dim Polyline As Object

 

Dim Coordinates (5) As Double

 

Coordinates(0) = 4: Coordinates(1) = 1

Coordinates(2) = 7: Coordinates(3) = 3

Coordinates(4) = 2: Coordinates(5) = 6

 

Set Polyline = Shapes.AddPolyline(Coordinates)

Example 2

This script displays all the methods and properties in the Shapes collection.

Used by: Shapes collection