Ruler Object

The Ruler object contains the properties for the horizontal and vertical rulers in the plot window.

The following table provides the properties of the Ruler object:

Property

Description

Application

Returns the application object. It is a read-only property.

GridDivisions

Returns/sets the number of grid divisions per page unit.

Parent

Returns the parent object. It is a read-only property.

RulerDivisions

Returns/sets the number of ruler divisions per page unit.

ShowPosition

Returns/sets the show position state.

SnapToRuler

Returns/sets the snap to ruler state.

Example 1

This script displays all the properties in the Ruler object.

Example 2

This example shows how to access the Ruler object.

Sub Main

  

'Declares SurferApp as an object

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")

 

'Makes Surfer visible

SurferApp.Visible = True

 

'Declares Plot as an object

Dim Plot As Object

 

'Creates a plot document in Surfer and assigns it to the variable

'named "Plot"

Set Plot = SurferApp.Documents.Add(srfDocPlot)

 

'Declares Windows as an object

Dim Windows As Object

 

'Assigns the Windows Collection to the variable named "Windows"

Set Windows = SurferApp.Windows

 

'Declares PlotWindow as an object

Dim PlotWindow As Object

 

'Assigns the plot window to the variable named "PlotWindow"

Set PlotWindow = Windows.Item(1)

 

'Declares Ruler as an object

Dim Ruler As Object

 

'Returns a reference to the vertical ruler

Set Ruler = PlotWindow.VerticalRuler

 

End Sub