'Grids selected data columns in selected data file using 4 'gridding methods that support faults and produces contour 'maps of the resulting grids to compare results. '1. Go to Script | Run '2. Select data file and click Open. '3. Select BLN file and click Open. '4. Enter the column number for the X data and click OK. '5. Enter the column number for the Y data and click OK. '6. Enter the column number for the Z data and click OK. '****************************************** Sub Main Dim SurferApp, Doc As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible = True 'Specify the height of the map ylength = 2 'Specifies the data file to grid Data$ = GetFilePath( , "dat;csv;xls;xlsx",path1, "Data file to grid") If Data$ ="" Then End Set Doc = SurferApp.Documents.Add 'Set data columns xcol= Val(InputBox$("Enter X column number. For example, Column A = 1", "X Column", "1")) ycol= Val(InputBox$("Enter Y column number. For example, Column B = 2", "Y Column", "2")) zcol= Val(InputBox$("Enter Z column number. For example, Column C = 3", "Z Column", "3")) 'Specifies the BLN file to use for the fault BLN$ = GetFilePath( , "bln",path1, "BLN file to use for the fault") If BLN$ ="" Then End '1. Inverse Distance SurferApp.GridData3(DataFile:=Data$, xcol:=xcol, ycol:=ycol, zcol:=zcol, ShowReport:=False, Algorithm:=1, OutGrid:=Data$+"_InverseDistance.grd", FaultFileName:=BLN$) Dim Map, Map_a As Object Set Map = Doc.Shapes.AddContourMap(GridFileName:=Data$+"_InverseDistance.grd") Map.yLength = ylength Map.xMapPerPU = Map.yMapPerPU If Map.Width<3.5 Then Map.xMapPerPU=Map.yMapPerPU Else Map.xLength=3.5 Map.Axes("Bottom Axis").Title = "Inverse Distance" Map.Axes("Bottom Axis").TitleFont.ForeColorRGBA.Color = srfColorRed Map.Left = 0.25 Map.Top = 9.50 'Overlays a base map of the BLN file Set Map_a = Doc.Shapes.AddBaseLayer(Map:=Map, ImportFileName:=BLN$) '2. Minimum Curvature SurferApp.GridData3(DataFile:=Data$, xcol:=xcol, ycol:=ycol, zcol:=zcol, ShowReport:=False, Algorithm:=3, OutGrid:=Data$+"_MinimumCurvature.grd", FaultFileName:=BLN$) Dim Map2 As Object Set Map2 = Doc.Shapes.AddContourMap(GridFileName:=Data$+"_MinimumCurvature.grd") Map2.yLength = ylength Map2.xMapPerPU = Map.yMapPerPU If Map2.Width<3.5 Then Map2.xMapPerPU=Map2.yMapPerPU Else Map2.xLength=3.5 Map2.Axes("Bottom Axis").Title = "Minimum Curvature" Map2.Axes("Bottom Axis").TitleFont.ForeColorRGBA.Color = srfColorRed Map2.Left = 4.29 Map2.Top = 9.50 'Overlays a base map of the BLN file Set Map2_a = Doc.Shapes.AddBaseLayer(Map:=Map2, ImportFileName:=BLN$) '3. Nearest Neighbor SurferApp.GridData3(DataFile:=Data$, xcol:=xcol, ycol:=ycol, zcol:=zcol, ShowReport:=False, Algorithm:=6, OutGrid:=Data$+"_NearestNeighbor.grd", FaultFileName:=BLN$) Dim Map3 As Object Set Map3 = Doc.Shapes.AddContourMap(GridFileName:=Data$+"_NearestNeighbor.grd") Map3.yLength = ylength Map3.xMapPerPU = Map.yMapPerPU If Map3.Width<3.5 Then Map3.xMapPerPU=Map3.yMapPerPU Else Map3.xLength=3.5 Map3.Axes("Bottom Axis").Title = "Nearest Neighbor" Map3.Axes("Bottom Axis").TitleFont.ForeColorRGBA.Color = srfColorRed Map3.Left = 0.25 Map3.Top =6.45 'Overlays a base map of the BLN file Set Map3_a = Doc.Shapes.AddBaseLayer(Map:=Map3, ImportFileName:=BLN$) '4. Data Metrics SurferApp.GridData3(DataFile:=Data$, xcol:=xcol, ycol:=ycol, zcol:=zcol, ShowReport:=False, Algorithm:=11, OutGrid:=Data$+"_DataMetrics.grd", _ DataMetric:=23, SearchEnable:=True, SearchNumSectors:=2, SearchRad1:=2000, SearchRad2:=1500, FaultFileName:=BLN$) Dim Map4 As Object Set Map4 = Doc.Shapes.AddContourMap(GridFileName:=Data$+"_DataMetrics.grd") Map4.yLength = ylength Map4.xMapPerPU = Map.yMapPerPU If Map4.Width<3.5 Then Map4.xMapPerPU=Map4.yMapPerPU Else Map4.xLength=3.5 Map4.Axes("Bottom Axis").Title = "Data Metrics: Terrain Slope" Map4.Axes("Bottom Axis").TitleFont.ForeColorRGBA.Color = srfColorRed Map4.Left = 4.29 Map4.Top = 6.45 'Overlays a base map of the BLN file Set Map4_a = Doc.Shapes.AddBaseLayer(Map:=Map4, ImportFileName:=BLN$) End Sub