'Refresh.bas refreshes the grid and data files in all the overlays ' in a single map and maintains the scale and limits. 10 Jan 03 - TB ' Commented out incomplete code. ' Added message text. 10 Feb 05 - TB. Sub Main Debug.Print "----- ";Time;" -----" Set surf = GetObject(,"surfer.application") Set plotdoc1 = surf.ActiveDocument Set mf1 = plotdoc1.Shapes("Map") msg = "" With mf1 mapxscale = .xMapPerPU mapyscale = .yMapPerPU mapxlength = .xLength mapylength = .yLength mapxmin = .xMin mapxmax = .xMax mapymin = .yMin mapymax = .yMax For Each ovrly In .Overlays Select Case ovrly.Type Case srfShapeWireframe 'Can't refresh GRD file in wireframe, but ' need to restore Z scale and limits. Debug.Print ovrly.GridFile & ": Wireframe refresh not implemented." msg = msg & ovrly.GridFile & ": Wireframe refresh not implemented." & vbCrLf isthreed = True mapzscale = .zMapPerPU mapzlength = .zLength 'mapzmin = .zMin 'mapzmax = .zMax Case srfShapeSurface Debug.Print "Refresh Surface Map interactively only." msg = msg & "Refresh Surface Map interactively only." & vbCrLf isthreed = True issurface = True mapzscale = .zMapPerPU mapzlength = .zLength 'mapzmin = .zMin 'mapzmax = .zMax Case srfShapeBaseMap Debug.Print "Base map refresh not implemented." msg = msg & "Base map refresh not implemented." & vbCrLf Case srfShapePostmap 'Includes post and classed post maps. ovrly.DataFile = ovrly.DataFile Debug.Print ovrly.DataFile & " refresh in " & ovrly.Name & " completed." msg = msg & ovrly.DataFile & " refresh in " & ovrly.Name & " completed." & vbCrLf Case srfShapeContourMap ovrly.GridFile = ovrly.GridFile Debug.Print ovrly.GridFile & " refresh in " & ovrly.Name & " completed." msg = msg & ovrly.GridFile & " refresh in " & ovrly.Name & " completed." & vbCrLf Case srfShapeImageMap ovrly.GridFile = ovrly.GridFile Debug.Print ovrly.GridFile & " refresh in " & ovrly.Name & " completed." msg = msg & ovrly.GridFile & " refresh in " & ovrly.Name & " completed." & vbCrLf Case srfShapeReliefMap ovrly.GridFile = ovrly.GridFile Debug.Print ovrly.GridFile & " refresh in " & ovrly.Name & " completed." msg = msg & ovrly.GridFile & " refresh in " & ovrly.Name & " completed." & vbCrLf Case srfShapeVectorMap ' Debug.Print "VectorMap refresh not implemented." msg = msg & "VectorMap refresh not implemented." & vbCrLf 'ovrly.GridFile = ovrly.GridFile 'If '2-grid vector map then ' ovrly.SetInputGrids ' ovrly.GradientGridFile = ovrly.GradientGridFile ' ovrly.AspectGridFile = ovrly.AspectGridFile 'End If Case Else Debug.Print "Overlay:" & ovrly.Name End Select Next ovrly 'Set limits before scale. .SetLimits(mapxmin,mapxmax,mapymin,mapymax) Debug.Print "Limits restored." .xMapPerPU = mapxscale .yMapPerPU = mapyscale .xLength = mapxlength 'Length is based on limits and scale .yLength = mapylength ' so it's redundant to specify it here. Debug.Print "Scale restored." If isthreed And issurface Then .zMapPerPU = mapzscale .zLength = mapzlength '.zMin = mapzmin '.zMax = mapzmax Debug.Print "Z scale restored." End If End With 'mf1 MsgBox msg,vbOkOnly End Sub