PostLayer Object

The PostLayer object contains the properties and methods for a post map created in Surfer with the Shapes method, AddPostLayer or AddPostMap.

Derived from: Layer object, which is derived from Shape object(All methods and properties of Layer and Shape apply to this object.)

The following table provides the properties of the PostLayer object:

Property

Description

ActiveLabelSet

Returns/sets the active label set.

AngleCol

Returns/sets the column containing the symbol angle in degrees (0 if none).

DataFile

Returns/sets the name of the data file used to create the map.

FirstRow

Returns/sets the first row to use in the worksheet

HeightCol

Returns the worksheet column containing the heights for proportional scaling. It is a read-only property.

LabCol

Returns/sets the column containing the labels (0 if none).

LabelAngle

Returns/sets the label angle in degrees.

LabelFont

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

LabelFormat

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

LabelLine

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

LabelLineLength

Returns/sets the label line length in page units.

LabelPlane

Returns/sets the label plane.

LabelPos

Returns/sets the label position method.

LabelXOffset

Returns/sets the label position offset in the X direction (page units).

LabelYOffset

Returns/sets the label position offset in the Y direction (page units).

LastRow

Returns/sets the last row to use in the worksheet.

NumLabelSets

Returns/sets the number of label sets.

Opacity

Returns/sets the opacity.

ScaleValue1

Returns the first proportional scaling value (height column units). It is a read-only property.

ScaleValue2

Returns the second proportional scaling value (height column units). It is a read-only property.

ShowLegend

Returns/sets a top level legend object with base layer data.

SymAngle

Returns/sets the symbol angle in degrees.

Symbol

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

SymbolColorCol

Returns/sets the symbol color column.

SymbolColorMap

Returns the ColorMap object when using a symbol color column. It is a read-only property.

SymbolColorMethod

Returns/sets the symbol color method when using a symbol color column.

SymbolHeight1

Returns the symbol height when the data equals ScaleValue1 (page units). It is a read-only property.

SymbolHeight2

Returns the symbol height when the data equals ScaleValue2 (page units). It is a read-only property.

SymCol

Returns/sets the column containing the symbol type (0 if none).

SymFrequency

Returns/sets the symbol frequency.

SymSizeMethod

Returns the symbol scaling method. It is a read-only property.

xCol

Returns/sets the column containing the X coordinates (1-based).

yCol

Returns/sets the column containing the Y coordinates (1-based).

The following table provides the methods of the PostLayer object:

Method

Description

RemoveLabelSet

Removes a specified label set.

SetInputData

Sets the input data file and columns. The SetInputData2 method should be used instead of this method when the worksheet being loaded is an Excel file where the sheet name needs to be specified.

SetInputData2

Sets the input data file and columns. It can also be used to specify any data import options when loading a data file.

SetSymbolScaling

Sets the symbol scaling parameters.

Remarks

The SymCol is the symbol or glyph number as it appears in the Symbol Properties dialog. This is the 0-based offset of the symbol within the symbol set.

Post map data files can contain a column defining which symbol set and symbol index to use for each posted point. This information can be specified in one of three ways:

SymbolSet:Index

This form allows both the symbol set and the symbol index to be specified. SymbolSet specifies the face name of the desired symbol set. The colon character must appear between the symbol set and the index. If the specified face name is invalid, the default symbol set specified in the Post Map Properties dialog is used instead.

Index

If a single integer is specified, it is interpreted as a symbol index into the current symbol set. The current symbol set is the last specified symbol set or the default symbol set specified in the Post Map Properties dialog.

<Empty>

If the cell is empty, the last specified symbol set and default symbol index is used.

Example

The following script demonstrates how the PostLayer object is used in reference to the MapFrame object.

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 MapFrame as an object

Dim MapFrame As Object

 

'Creates a post map and assigns the map coordinate system to the

'variable named "MapFrame"

Set MapFrame = Shapes.AddPostMap(DataFileName:=SurferApp.Path+"\Samples\demogrid.dat")

 

'Declares PostLayer as an object

Dim PostLayer As Object

 

'Assigns the post map properties to the variable named "PostLayer"

Set PostLayer = MapFrame.Overlays(1)

 

End Sub