When generating a function grid you may want to specify a grid file format that is not the default. The OutGridOptions parameter of the GridFunction command allows you to do this via automation as shown in the sample script below.
Example: (OutGridPath on line 5 will need to be updated):
Sub Main Dim Surfer As Object Set Surfer = GetObject(, "Surfer.Application") Set OptionsRefs = "ForgetOptions=1, ValuesPerLine=4, BlankLinePerGridRow=1" Set OutGridPath = "C:\Users\David\Documents\" 'outputs a grid (Surfer 6 Text Grid format) and uses this file type's 'ValuesPerLine' and 'BlankLinePerGridRow' export options Surfer.GridFunction2(Function:="z=x*y", xMin:=0, xMax:=15, xInc:=.5, yMin:=-10, yMax:=10, yInc:=1.5, OutGrid:=OutGridPath + "function.grd", OutFmt:=srfGridFmtAscii, OutGridOptions:=OptionsRefs) End Sub
Updated November 2021
Comments
0 comments
Please sign in to leave a comment.