ViewshedLayer Object

The ViewshedLayer object contains methods and properties of a viewshed created in Surfer with the Shapes method AddViewshedlayer.

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 ViewshedLayer object:

Property

Description

Fill

Returns the FillFormat object for the viewshed. It is a read-only property.

GridFile

Returns/sets the name of the grid file used to create the viewshed.

Line

Returns the LineFormat object for the viewshed. it is a read-only property.

ObstructionsHeight

Returns/sets the obstruction height for the viewshed.

Opacity

Returns/sets the opacity of the viewshed.

ReceiverHeight

Returns/sets the receiver height for the viewshed.

SamplingDistance

Returns/sets the sampling distance for the viewshed.

TransmitterHeight

Returns/sets the transmitter height for the viewshed.

TransmitterSymbol

Returns the MarkerFormat object for the symbol used to indicate the transmitter location. It is a read-only property.

TransmitterX

Returns/sets the x-coordinate for the transmitter location.

TransmitterY

Returns/sets the y-coordinate for the transmitter location.

ViewRadius

Returns/sets the viewshed radius.

ViewStartAngle

Returns/sets the viewshed start angle.

ViewSweepAngle

Returns/set the viewshed sweep angle.

The following table provides the methods of the ViewshedLayer object:

Method

Description

ShowRegions

Sets the viewshed state to show visible or invisible regions.

Example

The following script demonstrates how the ViewshedLayer object is used in reference to the ContourLayer 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 vector map and assigns the map coordinate system to the

'variable named "MapFrame"

Set MapFrame = Shapes.AddContourMap(GridFileName:=SurferApp.Path+"\Samples\demogrid.grd")

 

'Declares ContourLayer as an object

Dim ContourLayer As Object

 

'Assigns the contour map properties to the variable named "ContourLayer"

Set ContourLayer = MapFrame.Overlays(1)

 

'Creates a viewshed with the ContourLayer object and assigns the

'viewshed properties to the variable named "ViewshedLayer"

Set ViewshedLayer = Shapes.AddViewshedLayer(MapLayer:=ContourLayer, PointX:=2.8, PointY:=3.5)

 

End Sub