Level Object
Level objects are individual members of the Levels collection. A Level object represents all the properties associated with a contour or wireframe level, including line style, color, thickness, fill properties, hachuring, and contour level.
The following table provides the properties of the Level object:
Property |
Description |
Returns the application object. It is a read-only property |
|
Returns the fill format object for this level. It is a read-only property. |
|
Returns the line format object for this level. It is a read-only property. |
|
Returns the parent object. It is a read-only property. |
|
Returns/sets the show hachure state. |
|
Returns/sets the show label state. |
|
Returns the contour value. It is a read-only property. |
*default property
Example
The following script demonstrates how the Level object is used in reference to the Levels 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 MapFrame as an object
Dim MapFrame As object
'Creates a contour 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)
'Declares Levels an object
Dim Levels As Object
'Assigns the Levels collection to the variable named "Levels"
Set Levels = ContourLayer.Levels
'Declares SeventhContour as an object
Dim SeventhContour As Object
'Assigns the seventh contour to the variable named
'"SeventhContour
Set SeventhContour = Levels(7)
End Sub