GridXYZC Object
The GridXYZC object represents a 3D matrix of data values. Grids are used to create 3D volume renders, 2D contour maps, and several additional map types in Surfer. By using the methods and properties of the GridXYZC object, 3D grids can be created, loaded from disk, queried, modified, and saved back to disk.
The following table provides the properties of the GridXYZC object:
Property |
Description |
Returns the application object. It is a read-only property. |
|
Returns/sets the NoData value. |
|
Returns the filename of the grid (if any). It is a read-only property. |
|
Returns the parent object. It is a read-only property. |
|
Returns/sets the maximum X coordinate of the grid. |
|
Returns/sets the minimum X coordinate of the grid. |
|
Returns the size of a grid cell in the X direction (data units). It is a read-only property. |
|
Returns the number of grid nodes in the X direction. It is a read-only property. |
|
Returns/sets the maximum Y coordinate of the grid. |
|
Returns/sets the minimum Y coordinate of the grid. |
|
Returns the size of a grid cell in the Y direction (data units). It is a read-only property. |
|
Returns the number of grid nodes in the Y direction. It is a read-only property. |
|
Returns/sets the maximum Z coordinate of the grid. |
|
Returns/sets the minimum Z coordinate of the grid. |
|
Returns the size of a grid cell in the Z direction (data units). It is a read-only property. |
|
Returns the number of grid nodes in the Z direction. It is a read-only property. |
|
Returns/sets the maximum C coordinate of the grid. |
|
Returns/sets the minimum C coordinate of the grid. |
The following table provides the methods of the Grid object:
Method |
Description |
Allocates the grid storage at the specified resolution. |
|
Assigns the NoData value to the node at a specified position. |
|
Gets the value of a node at a specified position. |
|
Returns true if the node at the specified position is assigned NoData. |
|
Loads the specified grid file with import options string. |
|
Saves the grid to a disk file. |
|
Sets the value of a node at a specified position. |
|
Returns the GridStatistics object for the grid. It is a read-only property. |
|
Recomputes the cMin and cMax fields based on the current node values |
Example 1
The following script demonstrates how the GridXYZC object is used in reference to the Application 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 Grid as an object
Dim Grid As Object
'Creates a new grid and assigns it to the variable named "Grid"
Set GridXYZC = SurferApp.NewGrid
GridXYZC.LoadFile(FileName:=SurferApp.Path+"\Samples\demogrid.grd", HeaderOnly:=True)
End Sub