📄 sizemove.bas
字号:
'==========================================================================
'SIZEMOVE.BAS
'
'This script demonstrates the following:
'
' Create a color filled contour map with a color scale
' Move entire map and color scale to lower left portion of page
' Create a second filled contour with a color scale
' Name and move the second map to the upper right portion of page
'
' 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")
'Assigns the location of the data and grid files to the variable "Path"
Path = SurferApp.Path + "\samples\"
'Makes Surfer visible
SurferApp.Visible = True
'Declares Doc as Object
Dim Doc As Object
'Creates a plot document in Surfer and assigns it to the variable "Doc"
Set Doc = SurferApp.Documents.Add
'Declares MapFrame1 as object
Dim MapFrame1 As Object
'Creates a contour map and assigns the map frame to the variable "MapFrame1"
Set MapFrame1 = Doc.Shapes.AddContourMap(GridFileName:=Path+"demogrid.grd")
'Declares ContourMap1 as an object
Dim ContourMap1 As Object
'Assigns the contour overlay to the variable "ContourMap1" for easier access
Set ContourMap1 = MapFrame1.Overlays(1)
'Color fill the contour map
ContourMap1.FillContours = True
'Shows the color scale bar
ContourMap1.ShowColorScale = True
'Loads the level file nolines.lvl
ContourMap1.Levels.LoadFile(Path+"nolines.lvl")
'Select contour map and color scale and move to lower left
MapFrame1.Selected = True
ContourMap1.ColorScale.Selected = True
Doc.Selection.Left = 1.0
Doc.Selection.Top = 4.0
Doc.Selection.Width = 3.5
Doc.Selection.Height = 3.0
'Deselect All
Doc.Selection.DeselectAll
'Declares MapFrame2 as object
Dim MapFrame2 As Object
'Creates a contour map and assigns the map frame to the variable "MapFrame2"
Set MapFrame2 = Doc.Shapes.AddContourMap(GridFileName:=Path+"demogrid.grd")
'Declares ContourMap2 as an object
Dim ContourMap2 As Object
'Assigns the contour overlay to the variable "ContourMap2" for easier access
Set ContourMap2 = MapFrame2.Overlays(1)
'Color fill the contour map
ContourMap2.FillContours = True
'Shows the color scale bar
ContourMap2.ShowColorScale = True
'Loads the level file bluelines.lvl
ContourMap2.Levels.LoadFile(Path+"bluelines.lvl")
'Select contour map and color scale and create selection object
MapFrame2.Selected = True
ContourMap2.ColorScale.Selected = True
'Move selection to upper right
Doc.Selection.Left = 4.5
Doc.Selection.Top = 10
Doc.Selection.Width = 3.5
Doc.Selection.Height = 3.0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -