ensvariable#

ensight.ensvariable(varname: str) Tuple[Any, int, int]#

This method will query EnSight command language variable values and return a tuple containing the value, its type and the scope it was found in (similar to the command language $ functionality), allowing access to variables defined directly in command language or computed constants. The function returns None if the variable cannot be found.

Args:
varname:

The name of the command language variable to query

Returns:

A tuple of the form: (value, type, scope). type will be 0 if the value is an integer, 1 if the value is a float and 2 if the value is a string. The scope is an integer that specifies where the variable was found. -2 if the variable is in the enscl namespace (for example, ensight.ensvariable(enscl.FOO)). -1 if the variable is an EnSight constant variable (file, case or computed variable). 0 if the variable is global in the command language interpreter (for example, $globalint BAR) or is a special command language variable like: APPTOTALTIMESTEPS. A positive integer if the variable is local in the command language interpreter. The number is the depth in the interpreter stack where the value is defined.