'========================================================================== 'ZCOLUMN.BAS ' 'This script demonstrates the following: ' ' Grids data with a new z column each time ' Creates and saves a new grid file each time ' ' SKP 9/99 Surfer 7 '========================================================================== Sub Main 'Declare the variable that will reference the application 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") 'Assigns the location of the data and grid files to the variable "Path" Path = SurferApp.Path + "\samples\" 'Makes Surfer visible SurferApp.Visible = True 'Declares Doc as Object Dim Doc As Object 'Loop for each new z column For Column = 3 To 5 cols$=Str$(Column) 'Creates a plot document in Surfer and assigns it to the variable "Doc" Set Doc = SurferApp.Documents.Add DataFile$ = GetFilePath$("","*",,"Select Data File",) 'Grid the data file using a different Z column each time & assign a new grid name If SurferApp.GridData (DataFile:=DataFile$, Algorithm:=srfKriging, _ DupMethod:=srfDupNone, ShowReport:=False, OutGrid:=Path+cols$, zcol:=column) _ = 0 Then End 'Create a contour map and assigns the map frame to the variable "MapFrame" Doc.Shapes.AddContourMap(GridFileName:=path+cols$+".grd") Next End Sub