''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ReplaceNodes.BAS will replace all Z values equal ' to or above a certain value with another value. ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub Main ''''''''''''' User Varibles '''''''''''' 'Set the theshold value Dim dbThreshold As Double dbThreshold = 70.0 'Set the replacement value for nodes >= dbThreshold Dim dbReplace As Double dbReplace = 0.0 'Set the path to which Surfer will dialog-prompt for file retrevial Dim stPath As String stPath = "C:\Temp\" 'Set the path and filename Surfer will save to Dim stSaveTo As String stSaveTo = stPath + "ReplacedNodes.grd" ''''''''''''''''''''''''''''''''''''''''''''''''''' 'Use existing Surfer 7 instance with a Plot1 window. 'Set surf = GetObject(,"Surfer.application") 'Set plot = surf.Documents("Plot1") 'Open a new Surfer 7 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) grid.LoadFile(GetFilePath( , "grd",stPath,"Open Grid File",0),False) Debug.Print "Processing GridRow:" For row=1 To Grid.NumRows() For col=1 To Grid.NumCols() 'If Grid.GetNode(row,col) >= dbThreshold Then Debug.Print "z=" + Grid.GetNode(row,col) If Grid.GetNode(row,col) >= dbThreshold Then Grid.SetNode(row,col,dbReplace) 'End If Next col Debug.Print row; If row Mod 20 = 0 Then Debug.Print Next row Debug.Print 'CR Grid.SaveFile(stSaveTo, srfGridFmtS7) shapes.AddSurface(stSaveTo) End Sub