Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

Name

gvar — Get Geocap variables and information

Syntax

set var [gvar variable]

Description

The gvar command in the context set var [gvar variable] will transfer the Geocap variable or information of the variable into the the Tcl variable; in this case var. The gvar command is used in advanced scripting when reading internal Geocap variables or information is necessary.

Arguments

There is a long list of variables that can be attached to the gvar command as an argument.

The internal alpha variables.

The following variables are sometimes called the alpha or @ variables because one can create a list by the command lst @.

ran

Result from random draw.

xmin

Minimum x value of active data.

xmax

Maximum x value of active data.

ymin

Minimum y value of active data.

ymax

Maximum y value of active data.

zmin

Minimum z value of active data.

zmax

Maximum z value of active data.

xwin

Minimum x of graphical window.

xwax

Maximum x of graphical window.

ywin

Minimum y of graphical window.

ywax

Maximum y of graphical window.

zwin

Minimum z of graphical window.

zwax

Maximum z of graphical window.

posx

x position of manipulator.

posy

y position of manipulator.

posz

z position of manipulator.

numpoint

Number of points in active data.

numcell

Number of cells in active data.

numscalar

Number of scalars in active data.

nrow

Number of elements in a row in active grid.

ncol

Number of elements in a column in active grid.

nlay

Number of layers in active grid.

xinc

x increment of active grid.

yinc

y increment of active grid.

zinc

z increment of active grid.

dispnum

Display list number.

rc

Return code from system: 0=error 1=OK.

cellid

Cell id from graphical cursor intersection.

pointid

Point id from graphical cursor intersection.

files

File number in get and put.

filetype

Filetype number of active data.

hasscalar

Returns 0 if active data has not scalars; 1 if has scalars.

isgrid

Return 0 if not; 1 if grid.

volume

Volume number from vol command.

lookup

Lookup value from lok command.

zsmin

Minimum z scalar value from active data.

zsmax

Maximum z scalar value from active data.

zcmin

Minimum z cell scalar value from active data.

zcmax

Maximum z cell scalar value from active data.

standev

Standard deviation from statistical calculation.

mean

Mean value from statistical calculation.

var

Free variable used by some commands.

window

Window number of active graphical window.

wintot

Total number of windows.

viewports

Total number of viewports.

activeview

Active viewport number.

actorid

Actor id of graphical display element.

xval

x curosor position.

yval

y cursor positon.

zval

z cursor position set in a 3D cube.

sval

Scalar value of cursor position.

seed

Seed value in statitical calculation.

median

Median value from statistical calculation.

mode

Mode value from statistical calculation.

skewness

Skewness value from statistical calculation.

kurtosis

Kurtosis value from statistical calculation.

correlation

Correlation value from statistical calculation.

horizons

Number of horizons read into workspace.

data

Data flag of active data: 0=error 1=OK.

upd

Up / down flag : up=1 down=-1 .

cubetype

2D or 3D cube flag.

levels

Number of contour levels.

area

Area of area calculation.

distance

Distance of distance calculation.

value

Used by various value output.

putnum

Number of files saved in put.

lc

Loop counter.

utmzone

Utm zone of active zone.

hemis

active hemisphere.

numlookup // number of lookup curves

Number of lookup curves in lookup calculation.

numpolygon // number of polygon curves

Number of polygon curves in lookup calculation.

zorigo

z origo value of image

slope

Slope of regression curve.

intercept

Interception of regression curve.

rangelo

Low range value of 3D cube or color table low range after [gvar ctable].

rangehi

High range value of 3D cube or color table high range after [gvar ctable].

newactorid

New (current) actor id of graphical display element.

diagonal

Diagonal of the graphical window.

oldx

x position of previous cursor.

oldy

y position of previous cursor.

oldz

z position of previous cursor.

angle

Angle of rotated dataset.

locori

Has local origo in dataset.

Additional system variables.

datalist

List of all datasets in workspace including active.

hilist

List of all datasets in workspace not including active.

hi | hiname name

Test if name present in hicore names

gridlist

List of only workspace grid names.

polylist // only hicore polydata names

List of only workspace polydata names.

list name

List of only workspace name data.

value x|y|z|s number

Get x,y,z or s value at number position in active data

field

Get a list of all field data.

fieldnum

Get a list of all numeric field data.

name | dataname" | *filename

Get the saved data name of active data.

numeric fielddata

Check if fielddata is numeric. 0 if not numeric, 1 if numeric.

type | datatype

Check data type of active data.

data

Check if valid data is present in active. 0 if invalid, 1 if valid

undef

Check if polydata contains undefined values.

rotation

Check if grid or cube have rotation.

fdata | fd name

Get a list of field data in name.

fdata | fd exist name

Check if field data name exists.

number variable

Check if variable is numeric. 0 if not numeric, 1 if numeric.

replaceblank string

Replace all blanks in string.

actorid

Return the actor id of the last graphic display action.

numcom

Get the number of components in active data.

xscreen

Get x size in pixels of screen.

yscreen

Get y size in pixels of screen.

dimension

Get dimension of dataset: grid or cube

scalar

Get existence of scalars in active data. 0 if not present, 1 if present.

numundef

Get number of undefined in a grid.

ctable range

Return type of range in the active standard color table.  0: data range, 1: relative range, 2: absolute range

The range values are in [gvar rangelo] and [gvar rangehi] .

ctable numcolors

Return number of colors in the active standard color table.

Examples

The following example shows the use of gvar command.

The task is to split a dataset into cells with 3 points in each cell. It uses advanced Geocap programming.

set numpoi [gvar numpoint] ; # get number of points
set n3 [expr $numpoi / 3]
set pp [points x y z] ; # transfer all points to the pp variable as a list
dhi data ; # delete data in workspace
set i 0
for {set j 0} {$j < $n3} {incr j} {
    for {set k 0} {$k < 3} {incr k} {
        set a [lindex $pp $i] ; # get the x coordinate
        incr i
        set b [lindex $pp $i] ; # get the y coordinate
        incr i
        set c [lindex $pp $i] ; # get the z coordinate
        eval sta $a $b $c ; # stack the coordinates
        incr i
    }
    rea ter ; # read the stack
    mhi data app ; # append data into workspace
}
 
# The result is saved in workspace data
mlo data ; # move data to active
set numcel [gvar numcell] ; # get number of cells
puts "Number of points: $numpoi  - Number of cells: $numcel" ; # list number of points and cells

  • No labels