GridResiduals2

GridResiduals2 calculates the difference between XYZ data and a grid surface and stores the residuals in a worksheet and can be used to specify the DataFileOptions parameter. Returns the worksheet object in a WksDocument object.

The GridResiduals2 command should be used instead of GridResiduals when the worksheet being loaded is an Excel file where the sheet name needs to be specified. It can also be used to specify any data import options when loading a data file.

Syntax

object. GridResiduals2( InGrid, DataFile, xCol, yCol, zCol, ResidCol, DataFileOptions )

Parameter

Type

Required/

Optional

Default

Description

InGrid

String

Required

 

This provides the path and file name of the input grid file.

DataFile

String

Required

 

This provides the path and file name of the XYZ data file.

xCol

Long

Optional

1 (Column A)

This specifies the column containing X data.

yCol

Long

Optional

2 (column B)

This specifies the column containing Y data.

zCol

Long

Optional

3 (column C)

This specifies the column containing Z data.

ResidCol

Long

Optional

4 (column D)

This specifies the column where the residuals are stored.

DataFileOptions

String

Optional

""

This specifies the data import options.

Example 1

This example demonstrates how to calculate the difference between the original Z values in the data file and the Z value in the grid file, using a sheet 2 from the Excel data file.

'Uses Grid Residuals and stores the residuals in Column D

Set Wks = SurferApp.GridResiduals2(InGrid:=GridFile, _

DataFile:="c:\temp\book1.xlsx", DataFileOptions:="sheet=sheet2", _

xCol:=1, yCol:=2, zCol:=3, ResidCol:=4)

Example 2

This script displays all the methods in the Application object.

Used by: Application object