7.1. Query Capability

The EnSight external command driver as first implemented with EnSight version 6.2.4, was purely a one-way interface. Namely, the external program could send command language to EnSight, but could not receive any type of information back (except for the error flag concerning success or failure of the command). Starting with EnSight 7.6, the capability to query EnSight for certain data has been added. While initially the scope of implemented queries is small, the implementation is general enough that future desirable queries should be easily added. Currently you can query for various transformation and viewport information.

The enscmddriver_query routine is driven by keywords. According to the keyword, the needed input parameters are defined, as well as the returned results.


Note:  In the descriptions of the transformation matrices below, the components of a 4 x 4 matrix are:

| a11 a12 a13 a14 |

| a21 a22 a23 a24 |

| a31 a32 a33 a34 |

| a41 a42 a43 a44 |


Query Keyword Details

Count of 3D arrow annotations

Keyword:

ARROW_COUNT

example command> query ARROW_COUNT
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of 3D arrow annotations
    On Failure -> (-1)
        ret_error_buf contains the error message string

3D arrow annotation display attributes

Keyword:

ARROW_DISPLAY_ATTRIBUTES

example command> query ARROW_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt             = 1
    param_array[0]        = 3d arrow’s id

Return Values:    
    On Success -> (1)
        ret_str_cnt       = total number of attributes
        ret_str_array     = 1D array of command strings, each NULL terminated
                             command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

3D arrow label text

Keyword:

ARROW_LABEL_TEXT

example command> query
Input:
    param_cnt             = 1    
    param_array[0]        = 3d arrow’s id

Return Values:
    On Success -> (1)
        ret_str_cnt       = 1
        ret_str_array     = 1D array containing the arrow label text
    On Failure -> (-1)
        ret_error_buf contains the error message string

Selected 3D arrows

Keyword:

ARROW_SELECTED_OBJECTS

example command> query ARROW_SELECTED_OBJECTS
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt     = total selected 3D arrows
        ret_int_array   = 1D array of selected 3d arrow ids
    On Failure -> (-1)
        ret_error_buf contains the error message string

Count of dial annotations

Keyword:

DIAL_COUNT

example command> query DIAL_COUNT
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of dial annotations
    On Failure -> (-1)
        ret_error_buf contains the error message string

Dial annotation display attributes

Keyword:

DIAL_DISPLAY_ATTRIBUTES

example command> query DIAL_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt             = 1    
    param_array[0]        = dial's id

Return Values:
    On Success -> (1)
        ret_str_cnt       = total number of attributes
        ret_str_array     = 1D array of command strings, each NULL terminated
                                command1 NULL command2 NULL ... lastcommand NULL
On Failure -> (-1)
ret_error_buf contains the error message string

Selected dials

Keyword:

DIAL_SELECTED_OBJECTS

example command> query DIAL_SELECTED_OBJECTS
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt         = total selected dials
        ret_int_array       = array of selected dial ids
    On Failure -> (-1)
        ret_error_buf contains the error message string

Flipbook creation attributes

Keyword:

FLIPBOOK_INFORMATION

example command> query FLIPBOOK_INFORMATION
Input:

Return Values:
    On Success -> (1)
        ret_str_cnt       = total number of attributes
        ret_str_array     = 1D array of command strings, each NULL terminated
                            command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Flipbook loaded or not?

Keyword:

FLIPBOOK_LOADED

example command> query FLIPBOOK_LOADED
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt         = 1
        ret_int_array[0]    = 1(Yes), 0(No)
On Failure -> (-1)
        ret_error_buf contains the error message string

Flipbook running or not?

Keyword:

FLIPBOOK_RUNNING

example command> query FLIPBOOK_RUNNING
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt         = 1    
        ret_int_array[0]    = 1(Yes), 0(No)
On Failure -> (-1)
        ret_error_buf contains the error message string

Number of Frames

Keyword:

FRAME_COUNT

example command> query FRAME_COUNT
Input:
    param_cnt = 0

Return Values:
    On Success -> (1)
        ret_int_cnt         = 1
        ret_int_array[0]    = number of frames
On Failure -> (-1)
        ret_error_buf contains the error message string

Frame Location

Keyword:

FRAME_LOCATION

example command> query FRAME_LOCATION 1
Input:
    param_cnt              = 1
    param_array[0] = frame’s id

Return Values:
    On Success -> (1)
        ret_float_cnt       = 12
        ret_float_array[0]  = x origin
        ret_float_array[1]  = y origin
        ret_float_array[2]  = z origin
        ret_float_array[3]  = x vector u
        ret_float_array[4]  = x vector v
        ret_float_array[5]  = x vector w
        ret_float_array[6]  = y vector u
        ret_float_array[7]  = y vector v
        ret_float_array[8]  = y vector w
        ret_float_array[9]  = z vector u
        ret_float_array[10] = z vector v
        ret_float_array[11] = z vector w
    On Failure -> (-1)
        ret_error_buf contains the error message string

Count of gauge annotations

Keyword:

GAUGE_COUNT

example command> query GAUGE_COUNT
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt = 1
        ret_int_array[0] = number of gauge annotations
    On Failure -> (-1)
        ret_error_buf contains the error message string

Gauge annotation display attributes

Keyword:

GAUGE_DISPLAY_ATTRIBUTES

example command> query GAUGE_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt      = 1
    param_array[0] = gauge's id

Return Values:
    On Success -> (1)
        ret_str_cnt = total number of attributes
        ret_str_array = 1D array of command strings, each NULL terminated
            command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Selected gauges

Keyword:

GAUGE_SELECTED_OBJECTS

example command> query GAUGE_SELECTED_OBJECTS
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt     = total selected gauges
        ret_int_array   = array of selected gauge ids
    On Failure -> (-1)            
        ret_error_buf contains the error message string

Number of legend annotations

Keyword:

LEGEND_COUNT

example command> query LEGEND_COUNT
Input:
param_cnt                = 0

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of legend annotations
    On Failure -> (-1)
        ret_error_buf contains the error message string

Legend's display attributes

Keyword:

LEGEND_DISPLAY_ATTRIBUTES

example command> query LEGEND_DISPLAY_ATTRIBUTES 1
Input:
param_cnt                 = 1
param_array[0]            = legend’s id (0-based)

Return Values:
    On Success -> (1)
        ret_char_cnt = number of attributes + 2
        ret_char_array[0] = legend description, format, and attribute commands with values
                            desc NULL format NULL command1 NULL command2 NULL ...
lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Selected legends

Keyword:

LEGEND_SELECTED_OBJECTS

example command> query LEGEND_SELECTED_OBJECTS
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt     = total selected legends
        ret_int_array   = array of selected legend ids
    On Failure -> (-1)
        ret_error_buf contains the error message string

Number of line annotations

Keyword:

LINE_COUNT

example command> query LINE_COUNT
Input:
param_cnt                = 0

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of line annotations
    On Failure -> (-1)
        ret_error_buf contains the error message string

Lines's display attributes

Keyword:

LINE_DISPLAY_ATTRIBUTES

example command> query LINE_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt             = 1
    param_array[0]        = line’s id (0-based)

Return Values:
    On Success -> (1)
        ret_char_cnt      = number of attributes
        ret_char_array[0] = attribute commands with values
                                command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Selected lines

Keyword:

LINE_SELECTED_OBJECTS

example command> query LINE_SELECED_OBJECTS
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt     = total selected lines
        ret_int_array   = array of selected line ids
    On Failure -> (-1)
        ret_error_buf contains the error message string

Number of logo annotations

Keyword:

LOGO_COUNT

example command> query LOGO_COUNT
Input:
    param_cnt             = 0

Return Values:
    On Success -> (1)    
        ret_int_cnt       = 1
        ret_int_array[0]  = number of logo annotations
    On Failure -> (-1)
        ret_error_buf contains the error message string

Logo's display attributes

Keyword:

LOGO_DISPLAY_ATTRIBUTES

example command> query LOGO_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt = 1
    param_array[0]         = logo’s id (0-based)

Return Values:
    On Success -> (1)
        ret_char_cnt       = number of attributes
        ret_char_array[0]  = attribute commands with values
                                command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)    
        ret_error_buf contains the error message string

Selected logos

Keyword:

LOGO_SELECTED_OBJECTS

example command> query LOGO_SELECTED_OBJECTS
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt     = total selected logos
        ret_int_array   = array of selected logo ids
    On Failure -> (-1)
        et_error_buf contains the error message string

Message Window contents

Keyword:

MESSAGES

example command> query MESSAGES
Input:
    param_cnt             = 0

Return Values:    
    On Success -> (1)
        ret_char_cnt      = 1
        ret_char_array[0] = message window contents
    On Failure -> (-1)
        ret_error_buf contains the error message string

Part's display attributes

Keyword:

PART_DISPLAY_ATTRIBUTES

example command> query PART_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt             = 1
    param_array[0]        = part’s id as returned from “query PART_OBJECTS”

Return Values:
    On Success -> (1)
        ret_char_cnt      = number of attributes
        ret_char_array[n] = attribute commands with values
                                command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Element's id and X,Y,Z model location of pick point on the element

Keyword:

PART_ELEMENT_PICKEDBYWINXY

example command> query PART_ELEMENT_PICKEDBYWINXY x y
Input:
    param_cnt              = 2
    mouse pointer location(X Y) as returned by WINDOW_MOUSELASTPRESS_INFO, so:    
    param_array[0]         = x location
    param_array[1]         = y location

Return Values:
    On Success -> (1)
        ret_int_cnt        = 1
        ret_int_array[0]   = element id
        ret_float_cnt = 3
        ret_float_array[0] = X model location
        ret_float_array[1] = Y model location
        ret_float_array[2] = Z model location
    On Failure -> (-1)
        ret_error_buf contains the error message string

Element's id at model coordinate(X,Y,Z)

Keyword:

PART_ELEMENT_PICKEDBYWORLDXYZ

example command> query PART_ELEMENT_PICKEDBYWORLDXYZ x y z
Input:
    param_cnt             = 3
    model location(X Y Z), so:
    param_array[0]        = x location
    param_array[1]        = y location
    param_array[2]        = z location

Return Values:
    On Success -> (1)
        ret_int_cnt       = 1
        ret_int_array[0]  = element id
    On Failure -> (-1)
        ret_error_buf contains the error message string

Node's id and X,Y,Z model location of pick point on the node

Keyword:

PART_NODE_PICKEDBYWINXY

example command> query PART_NODE_PICKEDBYWINXY x y
Input:    
    param_cnt              = 2    
    mouse pointer location(X Y) as returned by WINDOW_MOUSELASTPRESS_INFO, so:
    param_array[0]         = x location
    param_array[1]         = y location

Return Values:
    On Success -> (1)
        ret_int_cnt        = 1
        ret_int_array[0]   = node id
        ret_float_cnt = 3
        ret_float_array[0] = X model location
        ret_float_array[1] = Y model location
        ret_float_array[2] = Z model location
    On Failure -> (-1)
        ret_error_buf contains the error message string

Node's id at model coordinate(X,Y,Z)

Keyword:

PART_NODE_PICKEDBYWORLDXYZ

example command> query PART_NODE_PICKEDBYWORLDXYZ x y z
Input:    
    param_cnt             = 3
    model location(X Y Z), so:
    param_array[0]        = x location
    param_array[1]        = y location
    param_array[2]        = z location

Return Values:
    On Success -> (1)
        ret_int_cnt       = 1
        ret_int_array[0]  = node id    
    On Failure -> (-1)
        ret_error_buf contains the error message string

Part general existence information

Keyword:

PART_OBJECTS

example command> query PART_OBJECTS
Input:
    param_array_cnt = 0

Return Values:
    On Success -> (1)
        ret_int_cnt = number of parts + 1
        ret_int_array[0] = number of parts
        ret_int_array[1] = ID for part 1
        ret_int_array[2] = ID for part 2
        ret_int_array[3] = ID for part 3 .
                .
                .
                .
        ret_int_array[number of parts] = ID for last part
        ret_charstr_cnt = number of parts
        ret_char_str = name_of_part1 NULL name_of_part2 NULL ... name_of_lastpart NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Part's id and X,Y,Z model location of pick point on the part

Keyword:

PART_PICKED

example command> query PART_PICKED x y
Input:
    param_cnt      = 2
    mouse pointer location(X Y) as returned by WINDOW_MOUSELASTPRESS_INFO, so:
    param_array[0] = x location
    param_array[1] = y location

Return Values:
    On Success -> (1)
        ret_int_cnt        = 1
        ret_int_array[0]   = part id
        ret_float_cnt      = 3
        ret_float_array[0] = X model location
        ret_float_array[1] = Y model location
        ret_float_array[2] = Z model location
    On Failure -> (-1)
        ret_error_buf contains the error message string

Part selection information

Keyword:

PART_SELECTED_OBJECTS

example command> query PART_SELECTED_OBJECTS
Input:
    param_array_cnt = 0

Return Values:
    On Success -> (1)
        ret_int_cnt      = number of selected parts + 1
        ret_int_array[0] = number of selected parts    
        ret_int_array[1] = ID for part 1
        ret_int_array[2] = ID for part 2
        ret_int_array[3] = ID for part 3 .
                .
                .
        ret_int_array[number of parts] = ID for last selected part
        ret_charstr_cnt = number of selected parts
        ret_char_str = name_of_part1 NULL name_of_part2 NULL ... name_of_lastpart NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Number of plotters

Keyword:

PLOT_COUNT

example command> query PLOT_COUNT
Input:
    param_cnt = 0

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of plotters
    On Failure -> (-1)
        ret_error_buf contains the error message string

Plotter's display attributes

Keyword:

PLOT_DISPLAY_ATTRIBUTES

example command> query PLOT_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt = 1
    param_array[0] = plotter’s id (0-based)

Return Values:
    On Success -> (1)
        ret_char_cnt      = number of attributes + 6
        ret_char_array[0] = plotter description NULL plotter title NULL
                            x axis title NULL y axis title NULL
                            x axis format string NULL y axis format string NULL
                            attribute commands with values separated by NULLs
    On Failure -> (-1)
        ret_error_buf contains the error message string

Plotter's id

Keyword:

PLOT_PICKED

example command> query PLOT_PICKED x y
Input:
    param_cnt      = 2
    mouse pointer location(X Y) as returned by WINDOW_MOUSELASTPRESS_INFO, so:
    param_array[0] = x location
    param_array[1] = y location

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = plotter id
    On Failure -> (-1)
        ret_error_buf contains the error message string

Number of queries

Keyword:

QUERY_COUNT

example command> query QUERY_COUNT
Input:
    param_cnt = 0

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of queries
    On Failure -> (-1)
        ret_error_buf contains the error message string

Query's display attributes

Keyword:

QUERY_DISPLAY_ATTRIBUTES

example command> query QUERY_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt      = 1
    param_array[0] = query’s id (0-based)

Return Values:
    On Success -> (1)
        ret_char_cnt      = number of attributes + 1
        ret_char_array[0] = query description NULL attribute commands
                            with values separated by NULLs
    On Failure -> (-1)
        ret_error_buf contains the error message string

Query item's id and value pair at pick point on curve

Keyword:

QUERY_PICKED

example command> query QUERY_PICKED x y
Input:
    param_cnt = 2    
    mouse pointer location(X Y) as returned by WINDOW_MOUSELASTPRESS_INFO, so:
    param_array[0] = x location
    param_array[1] = y location

Return Values:
    On Success -> (1)
        ret_int_cnt = 1
        ret_int_array[0] = query item id
        ret_float_cnt = 2
        ret_float_array[0] = X value
        ret_float_array[1] = Y value
    On Failure -> (-1)
        ret_error_buf contains the error message string

Query Probe's display attributes

Keyword:

QUERY_PROBE_ATTRIBUTES

example command> query QUERY_PROBE_ATTRIBUTES
Input:

Return Values:
    On Success -> (1)
        ret_str_cnt   = total number of attributes
        ret_str_array = 1D array of command strings, each NULL terminated
                        command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Count of probe queries

Keyword:

QUERY_PROBE_COUNT

example command> query QUERY_PROBE_COUNT
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of probe queries
    On Failure -> (-1)
        ret_error_buf contains the error message string

Query Probe's output

Keyword:

QUERY_PROBE_OUTPUT

example command> query QUERY_PROBE_OUTPUT
Input:
    param_cnt     = 2

Return Values:
    On Success -> (1)
        ret_char_cnt       = 1
        ret_char_array[0]  = query probe output
        ret_char_cnt       = 0
        ret_char_array     = <No output>
    On Failure -> (-1)
        ret_error_buf contains the error message string

Count of shape annotations

Keyword:

SHAPE_COUNT

example command> query SHAPE_COUNT
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of shape annotations
    On Failure -> (-1)
        ret_error_buf contains the error message string

Shape annotation display attributes

Keyword:

SHAPE_DISPLAY_ATTRIBUTES

example command> query SHAPE_DISPLAY_ATTRIBUTES 1
Input:    
    param_cnt = 1
    param_array[0] = shape's id

Return Values:
    On Success -> (1)
        ret_str_cnt     = total number of attributes
        ret_str_array   = 1D array of command strings, each NULL terminated
                        command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Selected shapes

Keyword:

SHAPE_SELECTED_OBJECTS

example command> query SHAPE_SELECTED_OBJECTS
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt   = total selected shapes
        ret_int_array = array of selected shape ids
    On Failure -> (-1)
        ret_error_buf contains the error message string

Number of text annotations

Keyword:

TEXT_COUNT

example command> query TEXT_COUNT
Input:
    param_cnt = 0

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of text annotations
    On Failure -> (-1)
        ret_error_buf contains the error message string

Text's display attributes

Keyword:

TEXT_DISPLAY_ATTRIBUTES

example command> query TEXT_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt = 1
    param_array[0] = text’s id (0-based)

Return Values:
    On Success -> (1)
        ret_char_cnt      = number of attributes
        ret_char_array[0] = attribute commands with values
                            command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

Text's display text

Keyword:

TEXT_DISPLAY_TEXT

example command> query TEXT_DISPLAY_TEXT 1
Input:
    param_cnt = 1
    param_array[0] = text’s id (0-based)

Return Values:
    On Success -> (1)
        ret_char_cnt      = 1
        ret_char_array[0] = text annotation’s text
    On Failure -> (-1)
        ret_error_buf contains the error message string

Selected text strings

Keyword:

TEXT_SELECTED_OBJECTS

example command> query TEXT_SELECTED_OBJECTS
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt      = total selected text strings
        ret_int_array    = array of selected text string ids
    On Failure -> (-1)
        ret_error_buf contains the error message string

The Center of Transformation

Keyword:

TRANSFORMATION_CENTER_OF

example command> query TRANSFORMATION_CENTER_OF 1
Input:    
    param_array_cnt = 1
    param_array[0] = Viewport number for the desired viewport (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt      = 3    
        ret_float_array[0] = x coordinate of center of transformation
        ret_float_array[1] = y coordinate of center of transformation
        ret_float_array[2] = z coordinate of center of transformation
    On Failure -> (-1)
        ret_error_buf contains the error message string

The Composite Transformation matrix - A combination of the look_at/look_from transform and the global transformation matrix.

Keyword:

TRANSFORMATION_COMPOSITE_MATRIX

example command> query TRANSFORMATION_COMPOSITE_MATRIX 1
Input:
    param_array_cnt = 1
    param_array[0] = Viewport number for the desired viewport (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt      = 16 (4 x 4 matrix)
        ret_float_array[0] = a11 ret_float_array[8] = a31
        ret_float_array[1] = a12 ret_float_array[9] = a32
        ret_float_array[2] = a12 ret_float_array[10] = a32
        ret_float_array[3] = a14 ret_float_array[11] = a34
        ret_float_array[4] = a21 ret_float_array[12] = a41
        ret_float_array[5] = a22 ret_float_array[13] = a42
        ret_float_array[6] = a22 ret_float_array[14] = a42
        ret_float_array[7] = a24 ret_float_array[15] = a44
    On Failure -> (-1)
        ret_error_buf contains the error message string

The Lookat Position

Keyword:

TRANSFORMATION_LOOKAT_POSITION

example command> query TRANSFORMATION_LOOKAT_POSITION 1
Input:
    param_array_cnt = 1
    param_array[0] = Viewport number for the desired viewport (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt = 3
        ret_float_array[0] = x coordinate of lookat point
        ret_float_array[1] = y coordinate of lookat point
        ret_float_array[2] = z coordinate of lookat point
    On Failure -> (-1)
        ret_error_buf contains the error message string

The Lookfrom Position

Keyword:

TRANSFORMATION_LOOKFROM_POSITION

example command> query TRANSFORMATION_LOOKFROM_POSITION 1
Input:
    param_array_cnt = 1
    param_array[0] = Viewport number for the desired viewport (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt      = 3
        ret_float_array[0] = x coordinate of lookfrom point
        ret_float_array[1] = y coordinate of lookfrom point
        ret_float_array[2] = z coordinate of lookfrom point    
    On Failure -> (-1)
        ret_error_buf contains the error message string

Perspective angle

Keyword:

TRANSFORMATION_PERANG

example command> query TRANSFORMATION_PERANG 0
Input:
        param_cnt      = 1
        param_array[0] = viewport number

Return Values:
    On Success -> (1)
        ret_float_cnt      = 1
        ret_float_array[0] = perang
    On Failure -> (-1)
        ret_error_buf contains the error message string

Projection matrix

Keyword:

TRANSFORMATION_PROJ_MATRIX

example command> query TRANSFORMATION_PROJ_MATRIX 0
Input:
    param_cnt = 1
    param_array[0] = viewport number
    
Return Values:
    On Success -> (1)
        ret_float_cnt = 16 (4 x 4 matrix)
        ret_float_array[0] = a11
        ret_float_array[1] = a12
        ret_float_array[2] = a13
        ret_float_array[3] = a14
        ret_float_array[4] = a21
        ret_float_array[5] = a22
        ret_float_array[6] = a23
        ret_float_array[7] = a24
        ret_float_array[8] = a31
        ret_float_array[9] = a32
        ret_float_array[10] = a33
        ret_float_array[11] = a34
        ret_float_array[12] = a41
        ret_float_array[13] = a42
        ret_float_array[14] = a43
        ret_float_array[15] = a44
    On Failure -> (-1)
        ret_error_buf contains the error message string
    where the matrix components are | a11 a12 a13 a14 |
                                    | a21 a22 a23 a24 |
                                    | a31 a32 a33 a34 |
                                    | a41 a42 a43 a44 |

The Rotate Transformation matrix

Keyword:

TRANSFORMATION_ROTATE_MATRIX

example command> query TRANSFORMATION_ROTATE_MATRIX 1
Input:
    param_array_cnt = 1
    param_array[0]  = Viewport number for the desired viewport (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt      = 16 (4 x 4 matrix)
        ret_float_array[0] = a11 ret_float_array[8] = a31
        ret_float_array[1] = a12 ret_float_array[9] = a32
        ret_float_array[2] = a12 ret_float_array[10] = a32
        ret_float_array[3] = a14 ret_float_array[11] = a34
        ret_float_array[4] = a21 ret_float_array[12] = a41
        ret_float_array[5] = a22 ret_float_array[13] = a42
        ret_float_array[6] = a22 ret_float_array[14] = a42
        ret_float_array[7] = a24 ret_float_array[15] = a44
    On Failure -> (-1)
        ret_error_buf contains the error message string

The Scale Transformation matrix

Keyword:

TRANSFORMATION_SCALE_MATRIX

example command> query TRANSFORMATION_SCALE_MATRIX 1
Input:
    param_array_cnt = 1
    param_array[0]  = Viewport number for the desired viewport (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt      = 16 (4 x 4 matrix)
        ret_float_array[0] = a11 ret_float_array[8] = a31
        ret_float_array[1] = a12 ret_float_array[9] = a32
        ret_float_array[2] = a12 ret_float_array[10] = a32
        ret_float_array[3] = a14 ret_float_array[11] = a34
        ret_float_array[4] = a21 ret_float_array[12] = a41
        ret_float_array[5] = a22 ret_float_array[13] = a42
        ret_float_array[6] = a22 ret_float_array[14] = a42
        ret_float_array[7] = a24 ret_float_array[15] = a44
    On Failure -> (-1)
        ret_error_buf contains the error message string

The Translate Transformation matrix

Keyword:

TRANSFORMATION_TRANSLATE_MATRIX

example command> query TRANSFORMATION_TRANSLATE_MATRIX 1
Input:
    param_array_cnt = 1
    param_array[0]  = Viewport number for the desired viewport (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt      = 16 (4 x 4 matrix)
        ret_float_array[0] = a11 ret_float_array[8] = a31
        ret_float_array[1] = a12 ret_float_array[9] = a32
        ret_float_array[2] = a12 ret_float_array[10] = a32        
        ret_float_array[3] = a14 ret_float_array[11] = a34
        ret_float_array[4] = a21 ret_float_array[12] = a41
        ret_float_array[5] = a22 ret_float_array[13] = a42
        ret_float_array[6] = a22 ret_float_array[14] = a42
        ret_float_array[7] = a24 ret_float_array[15] = a44
    On Failure -> (-1)
        ret_error_buf contains the error message string

Zclip locations

Keyword:

TRANSFORMATION_ZCLIP_LOCATIONS

example command> query TRANSFORMATION_ZCLIP_LOCATIONS
Input:
    param_array_cnt = 1
    param_array[0]  = Viewport number (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt      = 2
        ret_float_array[0] = near zplane z location
        ret_float_array[1] = far zplane z location
    On Failure -> (-1)
        ret_error_buf contains the error message string

Variable information - such as the active/inactive flag, current min and max values,expression for computed vars, etc.

Keyword:

VARIABLE_INFORMATION

example command> query VARIABLE_INFORMATION 1
Input:
    ret_param_cnt = 1
    ret_params[0] = variable number starting with 0 as returned            
                    from “query VARIABLE_OBJECTS”.

Return Values:
    On Success -> (1)
        ret_int_cnt = 1
        ret_int_array[0]   = active flag (0 if inactive, 1 if active)
    If Computed
        ret_int_count      = 2 + number of parts used to compute it.
        ret_int_array[0]   = active flag (0 if inactive, 1 if active)
        ret_int_array[1]   = count of parts used to compute it
        ret_int_array[2]   = 1st part used to compute it.
        ret_int_array[3]   = 2nd part used to compute it.
                . . .
        ret_int_array[2+n] = nth part used to compute it.
    If Scalar:
        ret_float_cnt = 2
        ret_float_array[0] = min value
        ret_float_array[1] = max value
    If Vector:
        ret_float_cnt = 8
        ret_float_array[0] = x comp min value
        ret_float_array[1] = x comp max value
        ret_float_array[2] = y comp min value
        ret_float_array[3] = y comp max value
        ret_float_array[4] = z comp min value
        ret_float_array[5] = z compmax value
        ret_float_array[6] = magnitude min value
        ret_float_array[7] = magnitude max value
    If Computed:
        ret_charstr_cnt    = 1
        ret_char_str[0]    = command for calculator expression
    On Failure -> (-1)
        ret_error_buf contains the error message string

Variable general existence information

Keyword:

VARIABLE_OBJECTS

example command> query VARIABLE_OBJECTS
Input:
    param_array_cnt = 0

Return Values:
    On Success -> (1)
        ret_int_cnt = number of vars + 1
        ret_int_array[1] = type for variable 1
        ret_int_array[2] = type for variable 2
        ret_int_array[3] = type for variable 3 .
                .
                .
        ret_int_array[number of vars] = type for last variable
        ret_int_array[1 + number of vars] = order for variable 1
        ret_int_array[2 + number of vars] = order for variable 2
        ret_int_array[3 + number of vars] = order for variable 3 .
                .
                .
        ret_int_array[2 * number of vars] = order for last variable
        ret_charstr_cnt = number of variables
        ret_char_str = name_of_var1 NULL name_of_var2 NULL ... name_of_lastvar NULL
    On Failure -> (-1)    
        ret_error_buf contains the error message string
    Map of variable types:
        0 = Scalar
        1 = Vector
        2 = Tensor
        3 = Scalar Complex
        4 = Vector Complex
    Map of variable orders:
        0 = Per Case (constant)
        1 = Per Elem
        2 = Per Node

Current view mode - Helps in determining which menu to bring up. For example a menu with part or plotter actions.

Keyword:

VIEW_MODE

example command> query VIEW_MODE
Input:

Return Values:
    On Success -> (1)
        ret_char_cnt = 1
        ret_char_array = a string value which is one of:
                         Part,Frame,Annot,Plot,VPort
    On Failure -> (-1)
        ret_error_buf contains the error message string

Number of viewports

Keyword:

VIEWPORT_COUNT

example command> query VIEWPORT_COUNT
Input:
    param_cnt = 0

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = number of viewports
    On Failure -> (-1)
        ret_error_buf contains the error message string

Viewport's display attributes

Keyword:

VIEWPORT_DISPLAY_ATTRIBUTES

example command> query VIEWPORT_DISPLAY_ATTRIBUTES 1
Input:
    param_cnt      = 1
    param_array[0] = viewport’s id (0-based)

Return Values:
    On Success -> (1)
        ret_char_cnt      = number of attributes
        ret_char_array[0] = attribute commands with values
                            command1 NULL command2 NULL ... lastcommand NULL
    On Failure -> (-1)
        ret_error_buf contains the error message string

The Location of bottom left of Viewport - returned both as screen and as normalized coords

Keyword:

VIEWPORT_LOCATION

example command> query VIEWPORT_LOCATION 1
Input:
    param_array_cnt = 1
    param_array[0]  = Viewport number for the desired viewport (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt      = 2
        ret_float_array[0] = normalized window x coordinate of bottom left of viewport (0. to 1.)
        ret_float_array[1] = normalized window y coordinate of bottom left of viewport (0. to 1.)
        ret_int_cnt = 3
        ret_int_array[0]   = screen x coordinate of bottom left of viewport
        ret_int_array[1]   = screen y coordinate of bottom left of viewport
    On Failure -> (-1)
        ret_error_buf contains the error message string

Viewport's id

Keyword:

VIEWPORT_PICKED

example command> query VIEWPORT_PICKED x y
Input:
    param_cnt      = 2
    mouse pointer location(X Y) as returned by WINDOW_MOUSELASTPRESS_INFO, so:
    param_array[0] = x location
    param_array[1] = y location

Return Values:
    On Success -> (1)
        ret_int_cnt      = 1
        ret_int_array[0] = viewport id
    On Failure -> (-1)
        ret_error_buf contains the error message string

The Size of the Viewport, width and height - returned both as screen and as normalized values

Keyword:

VIEWPORT_SIZE

example command> query VIEWPORT_SIZE 1
Input:
    param_array_cnt = 1
    param_array[0]  = Viewport number for the desired viewport (zero based)

Return Values:
    On Success -> (1)
        ret_float_cnt      = 2
        ret_float_array[0] = normalized window x size of viewport (0. to 1.)
        ret_float_array[1] = normalized window y size of viewport (0. to 1.)
        ret_int_cnt = 3
        ret_int_array[0]   = screen x size of viewport
        ret_int_array[1]   = screen y size of viewport
    On Failure -> (-1)
        ret_error_buf contains the error message string

Window depth values

Keyword:

WINDOW_DEPTH_VALUES

example command> query WINDOW_DEPTH_VALUES
Input:
    param_cnt = 0

Return Values:
    On Success -> (1)
        ret_float_cnt      = xSize * ySize
        ret_float_array[n] = depth pixel interlaced values
                             if stereo, then the array is xSize * ySize * 2 and the
                             two stereo pairs are back to back
    On Failure -> (-1)
        ret_error_buf contains the error message string

Mouse current location and button information

Keyword:

WINDOW_MOUSECURRENT_INFO

example command> query WINDOW_MOUSECURRENT_INFO
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt        = 7
        query_int_array[0] = x
        query_int_array[1] = y
        query_int_array[2] = left mouse button state
        query_int_array[3] = middle mouse button state
        query_int_array[4] = right mouse button state
        query_int_array[5] = Control key down(1=True,0=False)
        query_int_array[6] = window
    On Failure -> (-1)
        ret_error_buf contains the error message string

Mouse location and button information at last mouse button press

Keyword:

WINDOW_MOUSELASTPRESS_INFO

example command> query WINDOW_MOUSELASTPRESS_INFO
Input:

Return Values:
    On Success -> (1)
        ret_int_cnt        = 7
        query_int_array[0] = x
        query_int_array[1] = y
        query_int_array[2] = double click(1=True,0=False)
        query_int_array[3] = left mouse button state
        query_int_array[4] = middle mouse button state
        query_int_array[5] = right mouse button state
        query_int_array[6] = Control key down(1=True,0=False)
    On Failure -> (-1)
        ret_error_buf contains the error message string

Window RGBA values

Keyword:

WINDOW_RGBA_VALUES

example command> query WINDOW_RGBA_VALUES
Input:
    param_cnt = 0

Return Values:
    On Success -> (1)
        ret_char_cnt = xSize * ySize * 4
        ret_char_array[n] = rgba pixel interlaced values
                            if stereo, then the array is xSize * ySize * 4 * 2 and the
                            two stereo pairs are back to back
    On Failure -> (-1)
        ret_error_buf contains the error message string

Window size

Keyword:

WINDOW_SIZE

example command> query WINDOW_SIZE
Input:
    param_cnt = 0

Return Values:
    On Success -> (1)
        ret_int_cnt      = 3
        ret_int_array[0] = x size (pixels)
        ret_int_array[1] = y size (pixels)        
        ret_int_array[2] = isStereo (boolean)
    On Failure -> (-1)
        ret_error_buf contains the error message string

The supplied sample external routine ( enscmddriver.c ) contains an example of the use of this routine.

See the Routine Descriptions section for an explanation of the other arguments to the routine.