SilverScreen Solid Modeler

Screen Refresh

Screen Refresh

Previous topic Next topic  

Screen Refresh

Previous topic Next topic JavaScript is required for the print function  

SilverScreenAPI

 

Screen Refresh

 

 


Controlling Screen Refresh

It is often desirable to perform commands without showing the results of the command on the screen. Several commands are provided for this purpose:

 

Command

Description

refresh off

disables screen refresh

refresh enable

re-enables screen refresh

refresh

repaints the screen

silent <command>

executes <command> without refresh

 

A situation that frequently occurs is the following: one wishes to first zoom the drawing and then to hide it. This is to be done without displaying the zooming operation on the screen. The following example illustrates:

 

C / C++ Code

 

 ss_command ( "refresh off" );

 ss_command ( "zoom drawing" );

 ss_command ( "refresh enable" );

 ss_command ( "hide drawing hidden-line" );

 

 

This same result can also be accomplished with the SILENT keyword:

 

C / C++ Code

 

 ss_command ( "silent zoom drawing" );

 ss_command ( "hide drawing hidden-line" );

 

 

 

Recording and Resetting Visibility

The record_visibility and reset_visibility functions are often used in combination with the REFRESH commands. Consider the following section:

 

C / C++ Code

 

 record_visibility (“\\”);

 ss_command ( "refresh off" );

 ss_command ( "isolate block \room4" );

 ss_command ( "refresh enable" );

 

 if ( pick_entity ( "Select object", BITS_OBJECT, path ) )

    ss_command ( "note The object %s was selected", path );

 else

    ss_command ( "note No object was selected" );

 

 ss_command ( "refresh off" );

 reset_visibility ( "\\" );

 ss_command ( "refresh enable" );

 

 

 

The record_visibility function records the current visibility settings for the specified BOS (possibly root), while reset_visibility returns the BOS to their original settings. Between these two commands, the block \room4 is isolated. Since pick_entity only allows the selection of visible objects, only those objects in the block \room4 will candidates for selection. Other objects, although they can be seen on the screen, are, in fact, invisible. Note that this process takes place without changing the image that is displayed on the screen.