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 |
Returns the FillFormat object for the viewshed. It is a read-only property. |
|
Returns/sets the name of the grid file used to create the viewshed. |
|
Returns the LineFormat object for the viewshed. it is a read-only property. |
|
Returns/sets the obstruction height for the viewshed. |
|
Returns/sets the opacity of the viewshed. |
|
Returns/sets the receiver height for the viewshed. |
|
Returns/sets the sampling distance for the viewshed. |
|
Returns/sets the transmitter height for the viewshed. |
|
Returns the MarkerFormat object for the symbol used to indicate the transmitter location. It is a read-only property. |
|
Returns/sets the x-coordinate for the transmitter location. |
|
Returns/sets the y-coordinate for the transmitter location. |
|
Returns/sets the viewshed radius. |
|
Returns/sets the viewshed start angle. |
|
Returns/set the viewshed sweep angle. |
The following table provides the methods of the ViewshedLayer object:
Method |
Description |
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