You are here: Surpac Concepts > Macros > SCL > System and Misc > SclSystemOption
GEOVIA Surpac

SclSystemOption

Overview

Manage default system option and status item values

Synopsis

SclSystemOption <sub option><optional parameters>

Description

The following sub options are available:

SclSystemOption get <optionName>
SclSystemOption set <optionName><optionValue>
SclSystemOption unset <optionName>
SclSystemOption getStatusItem <statusItemName>
SclSystemOption setStatusItem <statusItemName><statusItemValue>
SclSystemOption unsetStatusItem <statusItemName>

All Surpac products make use of a system defaults file, defaults.ssi, in which various system defaults are stored to configure the software subject to user preferences each time the software is started. The SclSystemOption, command permits you to get and set the value of any of the system options.

In addition the software also displays information on the status item bar and on menus and toolbars such as the working directory, point mode, design string, etc. These types of options, known as status items, can also be retrieved and set via this command.

Being able to access both these types of information may prove useful to script authors to determine certain behaviour and state of the software from an SCL script. See the SSI_ETC:defaults.ssi file for a complete list of the default options used by the software. An appendix of current status items is listed later.

CautionCaution: Altering the values of standard options from the system defaults file and standard status items is unsupported and not recommended. Changing these values may have unexpected side effects and cause the software to fail.

The SclSystemOption command also allows you as an Scl programmer to create, query, set, and destroy your own system options to store state information between script runs. You can also manage the state of status item information that you create on your custom menus and toolbars via this command.

Note that options are persistent for a session of the software. That is, once set, they retain their value only until the software is terminated. Setting a system option via this command does not save it to the system defaults file. If you wish to retain these values across sessions of the software you must write them to the system defaults file (defaults.ssi) or ensure that they are loaded from some other file by executing an SCL script after the software has been started.

Note: Caution must be exercised when setting the values for standard options that are defined in the defaults file. Options in this file fall into three distinct categories that are:

  • Options that can be set at any time and the new value is used at the very next opportunity. An example of such an option is grid colour option used in the example below.
  • Options whose values are checked only once by the software. Changing the values for these options after they have been checked has no impact at all.
  • Options whose values are checked only at the time the software is started. Changing these options from a TCL script has no effect under any circumstances.

If you wish to make use of the capability to set the values for options defined in the system defaults file you should experiment first and if the software does not behave correctly you should avoid setting the values for these options.

The options and values for options that are currently defined in the system defaults file are subject to change without notice in later versions of the software. You should be cautious in how you make use of this feature.

Synopsis

SclSystemOption <get><optionName>

Description

Get the current value of a system option. This may be either a system or your own user-defined option.

Arguments

  • <get>
  • A literal string to identify the sub function

  • <optionName>
  • The name of the option to get the value of

Returns

The value of the option. Note that if the option does not exist then a Tcl error is thrown.

Examples

# get the value of the grid colour
puts "System option 'grid colour=[SclSystemOption get {grid colour}]'"
# set and then retrieve the value of a user defined option
SclSystemOption set "my_option" "my special information"
puts "System option 'my_option=[SclSystemOption get my_option]'"

 

Synopsis

SclSystemOption <set><optionName><optionValue>

Description

Set the value of a system option. This may be either a standard system option or your own user-defined option. If the option does not previously exist then it is created.

Note: After setting a system option relating to Graphics, to apply the change you must add the following line to your script:
set status [SclFunction "SETTINGS" {}]

CautionCaution: Altering the values of standard options from the system defaults file and standard status items is unsupported and not recommended. Changing these values may have unexpected side effects and cause the software to fail.

Arguments

  • <set>
  • A literal string to identify the sub function

  • <optionName>
  • The name of the option to set the value of

  • <optionValue>
  • The value to store

Returns

True if the option is set, false otherwise

Examples

# set, retrieve, and unset the value of some user defined options
SclSystemOption set my_option "my special information"
puts "System option 'my_option=[SclSystemOption get my_option]'"
SclSystemOption unset my_option
SclSystemOption set cutOffGrade 0.03
puts "System option 'cutOffGrade=[SclSystemOption get cutOffGrade]'"
SclSystemOption unset my_option
SclSystemOption set  "db status" "opened"
puts "System option 'db status=[SclSystemOption get {db status}]'"
SclSystemOption unset "db status"

 

Synopsis

SclSystemOption <unset><optionName>

Description

Unset a user-defined option and clear memory associated with it.

Note that it is not recommended that you unset a standard system option as this can cause software instability as described above.

Arguments

  • <unset>
  • A literal string to identify the sub function

  • <optionName>
  • The name of the option to unset

Returns

True if the the option is unset, false otherwise

Examples

# set, retreive, and unset the value of some user defined options
SclSystemOption set my_option "my special information"
puts "System option 'my_option=[SclSystemOption get my_option]'"
SclSystemOption unset my_option
SclSystemOption set cutOffGrade 0.03
puts "System option 'cutOffGrade=[SclSystemOption get cutOffGrade]'"
SclSystemOption unset my_option
SclSystemOption set  "db status" "opened"
puts "System option 'db status=[SclSystemOption get {db status}]'"
SclSystemOption unset "db status"

 

Synopsis

SclSystemOption <getStatusItem><statusItemName>

Description

Get the value of a status item. The status item maybe a standard software status item name such as "point mode", "cwd", "design string", etc as listed in the appendix below, or maybe a user defined status item that you have placed on a menu or toolbar.

Arguments

  • <getStatusItem>
  • A literal string to identify the sub function

  • <statusItemName>
  • The name of the status item to get

Returns

The value of the requested status item. If the status item does not exist then a blank value is returned.

Examples

# get the values of some system options
set snapMode [SclSystemOption getStatusItem "snap mode"]
puts "snap mode is $snapMode"
set pointMode [SclSystemOption getStatusItem "point mode"]
puts "point mode is $pointMode"
set designStr [SclSystemOption getStatusItem "design string"]
puts "design string is $designStr"

 

Synopsis

SclSystemOption <setStatusItem><statusItemName><statusItemValue>

Description

Set the value of a status option. If the option does not previously exist it is created and set to the value specified.

Note that it is not recommended that you set the value of a standard status item as this may cause software instability as described above.

Arguments

  • <setStatusItem>
  • A literal string to identify the sub function

  • <statusItemName>
  • The name of the status item to set

  • <statusItemValue>
  • The value to store

Returns

True if the the status item is set, false otherwise

Examples

# set the value for a user defined menu toggle button
SclSystemOption setStatusItem myMenuToggle true
puts "State of my menu toggle is [SclSystemOption getStatusItem myMenuToggle]"
SclSystemOption unsetStatusItem myMenuToggle

 

Synopsis

SclSystemOption <unsetStatusItem><statusItemName>

Description

Unset a user-defined status item and clear memory associated with it.

Note that it is not recommended that you unset a standard system status item as this can cause software instability as described above.

Arguments

  • <unsetStatusItem>
  • A literal string to identify the sub function

  • <statusItemName>
  • The name of the status item to unset

Returns

True if the the status item is unset, false otherwise

Examples

# set the value for a user defined menu toggle button
SclSystemOption setStatusItem myMenuToggle true
puts "State of my menu toggle is [SclSystemOption getStatusItem myMenuToggle]"
SclSystemOption unsetStatusItem myMenuToggle

 

Status Item Appendix

The following appendix lists all current status items. Please note that these names and values may change in future versions of the software.

Item NamePossible valueItem NamePossible value
2d grid displaytrue | falsehidden surfacetrue | false
3d grid displaytrue | falsehsr_methodpainters | software z-buffer | hardware z-buffer
azimuthstring Noindicator variogram cutoffs<grade value>
azimuth_on_offtrue | falselanguage<name>
block edge displaytrue | falselayer<names>
block face displaytrue | falselayer names<name>
block model indicator kriging attribute<name>level<level No>
block model name<name>macro playbacktrue | false
camera projectiontrue | falsemacro recordtrue | false
cwd<name>plotting delta x<value>
database<name>plotting delta y<value>
design gradient<value>point modeAdd | Change| Insert
design string<string No>recording bm auditY | N
digitiser beepY | Nring design dump<value>
dipstring Noring design rig<rig name>
drillhole geology selectabilitytrue | falsering design section<section No>
drillhole label selectabilitytrue | falsering design strike<string No>
drillhole selectabilitytrue | falsesection<section No>
edge displaytrue | falsesheetsetup delta x<value>
face displaytrue | falsesheetsetup delta y<value>
face displaytrue | falsesnap modeon | off
graphics delta angle<value>spot lighttrue | false
graphics delta x<value>ui activetrue | false
graphics delta y<value>variogram type icontrue | false
graphics delta z<value>viewertrue | false
graphics depthtrue | falseviewport controlstrue | false
world quadrantNE | NW | SE | SW