SilverScreen Solid Modeler

The State class

The State class

Previous topic Next topic  

The State class

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

The State class

 

Structure

The State class is a sealed, abstract class that provides a host of properties, some read-only and some read-write, to access the current state of SilverScreen. It is a more convenient and intuitive method of acquiring or changing the data.

 

C# Code

 

 class State sealed abstract

    {

    // Read + Write CV_ properties

    static property bool CV_COMMANDS { get; set; }

 

    . . .

       

    // Read-only CV_ properties

    static property bool CV_GRID { get; }

       

    . . .

           

    // Miscellaneous read + write properties

    static property UnitsOfMeasure CurrentUnits  { get; set; }

    static property Notation CurrentNotation { get; set; }

 

    // Miscellaneious read-only properties

    static property double epsilon { get; }

    static property UInt32 ich { get; }    

    static property int multi_down { get; }

    static property int multi_right { get; }

    static property double snap_spacing { get; }

    static property int ss_errno { get; }

    static property SS_XYZ WorldXYZ { get; }

    static property double worldx { get; }

    static property double worldy { get; }

    static property double worldz { get; }

 

    // Read-only SSVarTypes substitutes

    static property int char_height  { get; }

 

    . . .

 

    };

 

 

 

 

 

Members

The following State properties provide read and write access to CV_ variables traditionally set with cv_set and obtained with cv_get.  For an explanation of the CV_ property names, see the Control Variables topic.

 

Type

Name

bool

CV_BREAK

bool

CV_COMMANDS

bool

CV_DEFER_PAINTING

bool

CV_DIALOGUE

bool

CV_DISPATCH_SYSCHAR

bool

CV_ENABLE_CLOSE

bool

CV_ENABLE_DLL_IDLE_PROCESSING

bool

CV_ERRORS

int

CV_ICON_AREA_WIDTH

bool

CV_JUMP_MENU

bool

CV_MESSAGES

Notation

CV_NOTATION

bool

CV_NOTES

int

CV_PAINT_ONE_WINDOW

bool

CV_PASSTHRU_CMDUI_ENABLE

int

CV_PROMPT_POINT_ANCHOR

bool

CV_QUICK_MENU

bool

CV_REDRAW_LOCAL

bool

CV_REFRESH

bool

CV_RESIZE_PERMITTED

int

CV_RETURN_ON_BUTTON

int

CV_REUSE_ICON

bool

CV_SINGLE_STEP

bool

CV_STATUS

bool

CV_TRACE_INFO

UnitsOfMeasure

CV_UNITS

bool

CV_VERY_QUIET

bool

CV_WINDOW_BORDER

 

The following State properties provide read-only access to  CV_ variables traditionally obtained with cv_get, and unavailable to cv_set. For an explanation of the CV_ property names, see the Control Variables topic.

 

Type

Name

int

CV_COMMAND_DEPTH

int

CV_CURRENT_SPACE

bool

CV_FILL_ENABLED

bool

CV_GRID

int

CV_ICOMMAND_DEPTH

bool

CV_MODIFIED

bool

CV_ORTHO

bool

CV_ORTHO_SNAP

bool

CV_PATTERNS_ENABLED

bool

CV_SNAP

bool

CV_TEXTURES_ENABLED

 

The following State properties provide read and write access to formatting choices:

 

Type

Name

Description

Notation

CurrentNotation

Gets or sets the current measurement notation

UnitsOfMeasure

CurrentUnits

Gets or sets the current units of measurement

 

The following State properties provide read-only access to miscellaneous state variables.

 

Type

Name

Description

double

epsilon

Equality threshold

UInt32

ich

Last inchar code

int

multi_down

Vertical motion of mouse

int

multi_right

Horizontal motion of mouse

double

snap_spacing

Snap spacing

int

ss_errno

SilverScreen error number

double

worldx

x-coordinate value of 3D cursor

SS_XYZ

WorldXYZ

Current 3D cursor position

double

worldy

y-coordinate value of 3D cursor

double

worldz

z-coordinate value of 3D cursor

 

The following State properties provide read-only access to device-related information

 

Type

Name

Description

int

char_height

Height of a character cell

int

char_width

Width of a character cell

int

num_colors

Number of colors for devices with 256 colors or less

int

schar_bot

Bottommost character position in screen

int

schar_height

Character height of screen

int

schar_left

Leftmost character position in screen

int

schar_right

Rightmost character position in sccreen

int

schar_top

Topmost character position in screen

int

schar_width

Width of screen in characters

int

spixel_height

Pixel height of the screen

int

spixel_width

Pixel width of the screen

int

vchar_bot

Bottommost character position in viewport

int

vchar_left

Leftmost character position in viewport

int

vchar_right

Rightmost character position in viewport

int

vchar_top

Topmost character position in viewport

int

vpixel_bot

Bottommost pixel position in viewport

int

vpixel_left

Leftmost pixel position in viewport

int

vpixel_right

Rightmost pixel position in viewport

int

vpixel_top

Topmost pixel position in viewport

 

 

 

See Also

Control Variables, cv_get, cv_set, SSVarTypes

 

 

Example

The following code gets and sets different State variables:

 

C# Code

 

using SilverSharp;

 

. . .

 

int height = State.spixel_height; // Get screen pixel height

 

State.CurrentUnits

     = UnitsOfMeasure.Feet;   // Set current units of notation

State.CurrentNotation

     = Notation.Architect;    // Set current measurement notation

 

State.CV_ERRORS = false;  // Disable reporting of errors

State.CV_REFRESH = false; // Disable screen refresh

 

SS_XYZ pt = State.WorldXYZ; // Get 3D Cursor position