SaveFile2 [Grid]
SaveFile2 saves the grid to a disk file.
Syntax
object.SaveFile2( FileName, Format, Options)
Parameter |
Type |
Required/ Optional |
Default |
Description |
FileName |
String |
Required |
|
This specifies the file name and extension to save (GRD or DAT) |
Format |
Required |
|
This specifies the grid format. |
|
Options |
String |
Optional |
"" |
This provides the output option string for the grid format. |
Example 1
This example demonstrates how to save a grid file.
Grid.SaveFile2(FileName:="c:\temp\dgrid1.grd", Format:=srfGridFmtS7)
Example 2
This example demonstrates how to save a grid file as SaveFile.grd and save the spatial reference as an Esri .prj file and an Esri AUX.XML file. SaveFile2 automatically saves spatial references to a Golden Software Reference (GSIREF) version 2 file.
Set Grid = Surfer.NewGrid
Grid.LoadFile2(InGridPath+"Conifer.grd")
Grid.CoordinateSystem = "Bonne Projection"
Grid.SaveFile2(OutGridPath + "SaveFile.grd", Options:="UseDefaults=1, ForgetOptions=1, SaveRefInfoAsGSIREF2=0, SaveRefInfoAsESRIprj=1,SaveRefInfoAsAUXXML=1")
Used by: Grid object , GridXYZC object