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

Application

Returns the application object. It is a read-only property.

BlankValue

Returns/sets the NoData value.

FileName

Returns the filename of the grid (if any). It is a read-only property.

Parent

Returns the parent object. It is a read-only property.

xMax

Returns/sets the maximum X coordinate of the grid.

xMin

Returns/sets the minimum X coordinate of the grid.

xSize

Returns the size of a grid cell in the X direction (data units). It is a read-only property.

xResolution

Returns the number of grid nodes in the X direction. It is a read-only property.

yMax

Returns/sets the maximum Y coordinate of the grid.

yMin

Returns/sets the minimum Y coordinate of the grid.

ySize

Returns the size of a grid cell in the Y direction (data units). It is a read-only property.

yResolution

Returns the number of grid nodes in the Y direction. It is a read-only property.

zMax

Returns/sets the maximum Z coordinate of the grid.

zMin

Returns/sets the minimum Z coordinate of the grid.

zSize

Returns the size of a grid cell in the Z direction (data units). It is a read-only property.

zResolution

Returns the number of grid nodes in the Z direction. It is a read-only property.

cMax

Returns/sets the maximum C coordinate of the grid.

cMin

Returns/sets the minimum C coordinate of the grid.

The following table provides the methods of the Grid object:

Method

Description

Allocate

Allocates the grid storage at the specified resolution.

BlankNode

Assigns the NoData value to the node at a specified position.

GetNode

Gets the value of a node at a specified position.

IsBlanked

Returns true if the node at the specified position is assigned NoData.

LoadFile

Loads the specified grid file with import options string.

SaveFile

Saves the grid to a disk file.

SetNode

Sets the value of a node at a specified position.

Statistics

Returns the GridStatistics object for the grid. It is a read-only property.

UpdateCLimits

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