Generic Data Sets

Generic Data Sets

Generic Data Sets

Generic Data Sets

The generic data sets represent a wide assortment of data that is used in SilverScreen. Each generic set has a corresponding constant that is defined in silver.h . The following is the list:

Name

Meaning

aux_string meaning

GN_DRW

drawing names

not used

GN_FNT

font libraries

not used

GN_DXF

IGES files

not used

GN_IGS

DXF files

not used

GN_EX

executable programs

not used

GN_SF

script files

not used

GN_ENV

private environments

not used

GN_ANN

annotation environments

not used

GN_SDF

screen definitions

not used

GN_MLB

model libraries

not used

GN_MODEL

library.model names

not used

GN_LIGHT

light names in current drawing

not used

GN_IMODEL

internal model names in current drawing

not used

GN_GROUP

named groups in current drawing

not used

GN_XLB

execution libraries

not used

GN_NAMED_VIEWS

named views

not used

GN_SCREENS

screen names

not used

GN_VARIABLES

active variables

not used

GN_ABLOCKS

A-blocks in drawing

not used

GN_WINDOW_ABLOCKS

A-blocks active in current window

not used

GN_PATTERN

patterns for a given library

name of pattern library

GN_LINE_STYLE

line styles for a given library

not used

GN_FILE

space-delimited tokens in a text file

text file name

GN_FILE2

lines from a text file

text file name

GN_MODEL2

model names for a given library

model library name

GN_XLB_ENTRY

entries in an execution library

library name

GN_FILE_NAME

wild-carded file names

specifies wild-card

GN_FNT_ENTRY

characters in a font library

font library name

GN_PRP

property libraries

not used

GN_PRP_ENTRY

entries in a property library

property library name

PROMPT_GENERIC

The prompt_generic function displays a dialog containing all names in a given data set. The user may then select one of these. This selection is then returned to the calling program. The following is an example:

C / C++ Code

if ( prompt_generic ( "Select light source", buf, GN_LIGHT, "" ) )

ss_command ( "note The selected light source is %s", buf );

else

ss_command ( "note No light source selected" );

PM_GENERIC

The pm_generic function adds a generic item to a panel menu. The button associated with this item gives the user the opportunity to select an item from the set. The follow­ing is an example:

C / C++ Code

buf[0] = 0;

pm_generic ( "Light source name", buf, GN_LIGHT, "" );

COLLECT_GENERIC

collect_generic is a function that assembles all items of a generic set into a list. This list may then be accessed through the get_generic function:

C / C++ Code

collect_generic ( GN_DRW, "" );

for ( i = 1 ; ; ++i )

{

if ( ! get_generic ( i, buf ) )

break;

ss_command ( "note item %d in the list is %s", i, buf );

}

The generic data set is specified by a constant and an auxiliary string. In most cases, the auxiliary string is empty (as shown in the examples above). The sets that require a non-empty string are the following:

Name

Description

GN_PATTERN

name of the pattern library

GN_LINE_STYLE

name of the line style library

GN_FILE

name of the file

GN_FILE2

name of the file

GN_MODEL2

name of the library

GN_XLB_ENTRY

name of the execution library

GN_FNT_ENTRY

name of the font library

For GN_PATTERNand GN_LINE_STYLE , only "silver" should be used since this is the only library presently supported.

GN_FILE requires the name of an ASCII text file containing space-delimited tokens. An example of such a file is the following (note that the end-of-line character counts as whitespace):

bill sue

mary kjel

henry

jack jill jim

GN_FILE2 requires the name of an ASCII text file where each line is an element in the data set. Example:

Jean Paul Sartre

Plato

Bertrand Russell

David Hume

GN_MODEL2 requires the name of the model library from which the model names are to be selected.