SilverScreen Solid Modeler

PrimBits

PrimBits

Previous topic Next topic  

PrimBits

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

PrimBits

 

Structure

PrimBits is a bit-flag enumeration used by the SilverSharp API routines that require primitive bits flags values, and is also present in the SilverSharp.PRIM_NODE object.

 

C# Code

   

  enum PrimBits

     {

     BITS_LINE,

       BITS_CHAMFER,

       BITS_LINE_PHONG,

     BITS_POLYGON,

       BITS_POLY_PHONG,

       BITS_REVERSED,

     BITS_VISITED,

     BITS_SPLINE,

     BITS_ROUND,

       BITS_CIRCLE,

       BITS_ARC,

         BITS_FILLET,

     BITS_PHANTOM,

     BITS_SPOINT,

     BITS_BEZIER,

       BITS_SINGLE,

     BITS_BPOINT,

     BITS_CLOSED,

     BITS_MESH,

     BITS_POLYLINE,

     BITS_POINT,

     BITS_HOLE,

     };

 

 

 

Members

See the bits member of the PRIM_NODE entity structure for an explanation of the PrimBits symbolic names.

 

 

See Also

PRIM_NODE, Enumerations

 

 

Example

The following code will prompt for a line primitive, then display a message if the line was created as the result of a chamfer operation.  Note that the SilverSharp version of pick_primitive expects a PrimBits enumeration as a parameter:

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 string line_path;

 

 if ( SC.pick_primitive("Select a line",

                        PrimBits.BITS_LINE,

                        out line_path) )

    {

    OBJECT_NODE parent;

    PRIM_NODE   prim = SC.get_prim(line_path, out parent);

 

    if ( ! PRIM_NODE.IsEmpty(prim) )

       {

       if ( prim.bits & PrimBits.BITS_CHAMFER )

          SC.error_message("The selected line is a chamfer");

       }

    }