Polyline Object

The Polyline object contains the properties of a polyline. Polylines are created with the AddPolyline and AddPolyline2 methods of the Shapes collection. Spline polylines are created with the AddPolyline2 method of the Shapes collection. 3D polylines are created with the AddPolyline3D method of the Shapes collection and the SetVertices method.

Derived from: Shape object(All methods and properties of Shape apply to this object.)

The following table provides all the properties of the Polyline object.

Property

Description

ArrowScale

Returns/sets the arrow scale factor.

EndArrow

Returns/sets the end line end style.

Line

Returns the line format object. It is a read-only property.

PolylineType

Returns the type of polyline.

StartArrow

Returns/sets the start line end style.

Vertices

Returns/sets the polyline vertices.

The following table provides the methods of the Polyline object:

Method

Description

Break

Breaks a polyline into two polylines at the specified coordinates

Example

The following script demonstrates how the Polyline object is used in reference to the Shapes collection.

Sub Main

 

'Declares SurferApp as an object

Dim SurferApp As Object

 

'Creates an instance of the Surfer Application object and assigns it to

'the variable named "SurferApp"

Set SurferApp = CreateObject("Surfer.Application")

 

'Makes Surfer visible

SurferApp.Visible = True

 

'Declares Plot as an object

Dim Plot As Object

 

'Creates a plot document in Surfer and assigns it to the variable named

'"Plot"

Set Plot = SurferApp.Documents.Add(srfDocPlot)

 

'Declares Shapes as an object

Dim Shapes As Object

 

'Assigns the Shapes collection to the variable named "Shapes"

Set Shapes = Plot.Shapes

 

'Declares PolyLine as an object

Dim PolyLine As Object

 

'Declares PolyLineArray as a double array

Dim PolyLineArray(5) As Double

 

PolyLineArray(0) = 4: PolyLineArray(1) = 1

PolyLineArray(2) = 7: PolyLineArray(3) = 3

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

 

'Creates a polyline and assigns it to the variable named "Polyline"

Set PolyLine = Shapes.AddPolyLine(PolyLineArray)

 

End Sub