AddPolygon3D

Automation AddPolygon3D method

Scripter AddPolygon3D

Automation Add Polygon 3D method

Scripter Add Polygon 3D

AddPolygon3D returns a new 3D Polygon shape. Returns a Polygon3D object.

Syntax

object.AddPolygon3D( VerticesXY, VerticesZ )

Parameter

Type

Default

Description

VerticesXY

Array of Doubles

Required. The X and Y coordinates (first entry is X coordinate of first vertex, second entry is Y coordinate of first vertex, third entry is X coordinate of second vertex, etc.)

VerticesZ

Array of Doubles

1

Required. The Z coordinates.

Example

This example demonstrates how to add a 3D polygon.

Sub Main

Set surf = GetObject(,"Surfer.Application")

 

Set plotdoc1 = surf.Documents.Add(srfDocPlot)

Set shapes1 = plotdoc1.Shapes

 

Dim polygon3dcoordsXY(7) As Double

polygon3dcoordsXY(0) = 1 : polygon3dcoordsXY(1) = 2

polygon3dcoordsXY(2) = 2 : polygon3dcoordsXY(3) = 2.5

polygon3dcoordsXY(4) = 3 : polygon3dcoordsXY(5) = 2.0

polygon3dcoordsXY(6) = 4 : polygon3dcoordsXY(7) = 2.5

 

Dim polygon3dcoordsZ(3) As Double

polygon3dcoordsZ(0) = 1 : polygon3dcoordsZ(1) = 2

polygon3dcoordsZ(2) = 3 : polygon3dcoordsZ(3) =4

 

Set polygon3d = shapes1.AddPolygon3D(polygon3dcoordsXY, polygon3dcoordsZ)

'use the 3D polygon object from here on

End Sub

Used by: Shapes collection