SilverScreen Solid Modeler

Groups and Wildcards

Groups and Wildcards

Previous topic Next topic  

Groups and Wildcards

Previous topic Next topic JavaScript is required for the print function  

SilverScreenAPI

 

Groups and Wildcards

 

 


Groups

SilverScreen supports primitive groups and entity groups.

 

Primitive groups are defined by a P-GROUP BEGIN command, a list of primitives that are to be in the group, and a P-GROUP END command.  Here is an example:

 

Command Script

 

 p-group begin

 p-group polygon \main\arm.3

 p-group polygon \main\arm.11

 p-group polygon \main\bolt.13
 p-group end

 

 

Q-groups are defined using a similar command sequence.  The following defines a group of objects:

 

Command Script

 

 q-group begin

 q-group object \main\arm

 q-group object \main\lever

 q-group object \main\bolt
 q-group end

 

 

 


Wildcards

Wildcards are one of the powerful tools available to the developer.  Wildcard path names may be used to create Q-groups.  They may also be used in commands.  The wildcard characters are:

 

Character

Meaning

*

Matches zero or more characters

?

Matches any single character

#

Identifies the highest numeric suffix

!

Located at any level of the hierarchy

,

Union of wildcard paths

 

The “*” and “?” are used in the conventional manner.  Here are several examples:

 


\part*

Identifies all entities with the prefix “part”.


\part7\*\arm

Identifies all entities with the name “arm” within a block within the block \part7.


\part?b

Identifies all entities with the prefix “part”, a single character, and the suffix “b”.

 

The “#” wildcard is used to identify, within a block, the entity with the highest numeric suffix for a given prefix.  Suppose that the blocks \part1, \part5, and \part14 appeared in the root block.  Then \part# would identify the block \part14.

 

The “#” wildcard is often used in combination with the creation of entities.  If the root block contained the blocks previously mentioned, then the command shown below will create a block \part15. Once this block has been created, it can be referenced by the wildcard path \part#.

 

Command Script

 

 create block at-root part#

 

 

The “!” wildcard will locate entities at any level of the drawing hierarchy.  !knob* will match any entity in the drawing that has the prefix knob.  Here it does not matter whether the entity is located at the root or six levels deep in the hierarchy.

 

The “,” wildcard allows the union of wildcard paths.  Suppose that we want to identify all entities in the drawing hierarchy that had either the prefix “knob” or the prefix “latch”.  This can be done with the wildcard union !knob*,!latch*.

 

Wildcards can be used to define groups.  They can also be used directly in commands.  The following illustrates both of these uses:

 

 

Command Script

 

 q-group begin

 q-group object !knob*

 q-group object !latch*

 q-group end

 


 

 surface object !knob*,!latch* color green