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.
Caution: 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>
- <optionName>
A literal string to identify the sub function
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" {}]
Caution: 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>
- <optionName>
- <optionValue>
A literal string to identify the sub function
The name of the option to set the value of
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>
- <optionName>
A literal string to identify the sub function
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>
- <statusItemName>
A literal string to identify the sub function
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>
- <statusItemName>
- <statusItemValue>
A literal string to identify the sub function
The name of the status item to set
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>
- <statusItemName>
A literal string to identify the sub function
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 Name | Possible value | Item Name | Possible value |
| 2d grid display | true | false | hidden surface | true | false |
| 3d grid display | true | false | hsr_method | painters | software z-buffer | hardware z-buffer |
| azimuth | string No | indicator variogram cutoffs | <grade value> |
| azimuth_on_off | true | false | language | <name> |
| block edge display | true | false | layer | <names> |
| block face display | true | false | layer names | <name> |
| block model indicator kriging attribute | <name> | level | <level No> |
| block model name | <name> | macro playback | true | false |
| camera projection | true | false | macro record | true | false |
| cwd | <name> | plotting delta x | <value> |
| database | <name> | plotting delta y | <value> |
| design gradient | <value> | point mode | Add | Change| Insert |
| design string | <string No> | recording bm audit | Y | N |
| digitiser beep | Y | N | ring design dump | <value> |
| dip | string No | ring design rig | <rig name> |
| drillhole geology selectability | true | false | ring design section | <section No> |
| drillhole label selectability | true | false | ring design strike | <string No> |
| drillhole selectability | true | false | section | <section No> |
| edge display | true | false | sheetsetup delta x | <value> |
| face display | true | false | sheetsetup delta y | <value> |
| face display | true | false | snap mode | on | off |
| graphics delta angle | <value> | spot light | true | false |
| graphics delta x | <value> | ui active | true | false |
| graphics delta y | <value> | variogram type icon | true | false |
| graphics delta z | <value> | viewer | true | false |
| graphics depth | true | false | viewport controls | true | false |
| world quadrant | NE | NW | SE | SW |