gridmath.bas

来自「Surfer是地学中常用的一个软件」· BAS 代码 · 共 43 行

BAS
43
字号
'============================================================================
'GRIDMATH.BAS
'
'	This script demonstrates the following:
'
'	How to use the grid math command, including functions
'
'												SKP 9/99 Surfer 7
'============================================================================

Sub Main
	'Declare the variable that will reference the application
	Dim SurferApp As Object
		
	'Creates an instance of the Surfer Application object 
	' and assigns it to the variable named "SurferApp"
	Set SurferApp = CreateObject("Surfer.Application")
	
	'Make Surfer visible
	SurferApp.Visible = True
	
	'Set path
	Path = SurferApp.Path + "\samples\"
	
	'Declares Doc as an Object
	Dim Doc As Object
	
	'Creates a new document with variable name "Doc"
	Set Doc = SurferApp.Documents.Add

	'Grid the data file using the current method
	SurferApp.GridData (DataFile:=Path+"demogrid.dat", ShowReport:=False, Algorithm:=srfKriging, _
		OutGrid:=Path+"sample.grd")
		
	'Use the GridMath command
	SurferApp.GridMath (InGridA:=Path+"sample.grd", InGridB:=Path+"demogrid.grd", _
		OutGridC:=Path+"test.grd", Function:="c=a+b", OutFmt:=srfGridFmtS7)
		
	'Creates a contour map
	Doc.Shapes.AddContourMap(GridFileName:=Path+"test.grd")

End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?