'Blank0.bas replaces the blanking value in a grid file with 0. 'The new grid is saved to a new grid file "\_Blank0.grd" 'A contour map is created from the new grid. Sub Main 'Use existing Surfer 7, 8, or 9 instance with a Plot1 window. 'Set surf = GetObject(,"Surfer.application") 'Set plot = surf.Documents("Plot1") 'Open a new Surfer 7, 8, or 9 instance. Set surf = CreateObject("Surfer.Application") Set plot = surf.Documents.Add(srfDocPlot) surf.Visible=True Set shapes = plot.Shapes Set grid = surf.NewGrid 'grid.LoadFile(surf.Path+"\samples\DemoRectBlank.grd",False) 'Select the [.GRD] file and its directory path gridFilePath = GetFilePath( , "grd",surf.Path+"\samples\","Open Grid File",0) 'Load the selected [.GRD] file grid.LoadFile(gridFilePath,False) Debug.Print "Processing GridRow:" For row=1 To Grid.NumRows() For col=1 To Grid.NumCols() 'If Grid.IsBlanked(row,col) = True Then Grid.SetNode(row,col) = 0 If Grid.IsBlanked(row,col) Then Grid.SetNode(row,col,0) 'Grid.SetNode(row,col) = 0.0 'Grid.SetNode(row,col,0) 'End If Next col Debug.Print row; If row Mod 20 = 0 Then Debug.Print Next row 'Append "_Blank0_" to the outup [.GRD] filename gridFilePath = Left(gridFilePath,InStrRev(gridFilePath,".")-1) & "_Blank0" & Mid(gridFilePath,InStrRev(gridFilePath,"."),4) Debug.Print 'CR 'Save the modified Grid Grid.SaveFile(gridFilePath, srfGridFmtS7) 'Create a ContourMap using this grid shapes.AddContourMap(gridFilePath) End Sub