'=================================== 'Visibility of Map Layer OFF.bas '=================================== 'Shows how to turn off the visibility of a map layer, similar to unchecking 'the checkbox in the Contents window next to the map layer in the UI. '=================================== Sub Main 'Initializes Surfer Dim SurferApp, Plot, PostLayer, PostLayer2 As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible = True Set Plot = SurferApp.Documents.Add 'Creates two post maps Set MapFrame = Plot.Shapes.AddPostMap(SurferApp.Path + "\samples\demogrid.dat") Set MapFrame2 = Plot.Shapes.AddPostMap(SurferApp.Path + "\samples\sample1.dat") 'Overlays the two post maps Plot.Shapes.SelectAll Plot.Selection.OverlayMaps Plot.Selection.DeselectAll 'Turns off the visibility of the second post layer Set NewMapFrame = Plot.Shapes.Item(1) Set PostLayer2 = NewMapFrame.Overlays(2) PostLayer2.Visible = False End Sub