PCL and Customization > Accessing the Patran Database > Groups
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Groups
Many items can be translated from the database in a group-wise mode. In other words, it is possible to translate only the nodes belonging to a specified group. Also when adding certain entities to the database, like nodes or multi-point constraints, it is necessary to specify which group these entities are to belong. Membership to a group affects the visibility of many entity types. For example, if a node is created in the database but is not made a member of any groups, it will not be visible on the screen even though it exists. Similarly, if a node is created in the database and is made a member of a group which is not posted in any of the posted viewports, it will not be seen on the screen until the group to which it is a member is posted to a posted viewpost. Therefore, association to groups is important to the organization and visualization of a model.
Most likely, when entities are put into the database, all of these entities will be assigned to a specified group or to the current group. But, different types of entities can be put into different specified groups.
When translating entities from the database, all entities, regardless of group membership, entities belonging to a specific group or list of groups, or only the entities belonging to the current group can be translated.
If translating the current group, determine its internal ID from the following function.
 
db_get_current_group_id
( <group_id> )
  
Output:
 
 
INTEGER
<group_id>
The internal ID of the currently active group.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and
a non zero value to indicate a change in status or an error.
Notes:
The C call is “DbGetCurrentGroupId”.
int DbGetCurrentGroupId ( group_id )
int 	*group_id
To determine the internal IDs of a group specified by its name, the following function may be used.
 
db_get_group_id
( <group_name>, <group_id> )
 
Input:
 
 
CHARACTER STRING
<group_name>
The name of the group of interest.
Output:
 
 
INTEGER
<group_id>
The internal ID of the specified group.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C call is “DbFGetGroupId”.
int DbFGetGroupId ( group_name, group_id )
 char	group_name [ ]
 int 	*group_id
 
db_get_group_name
(ID, name )
 
Input:
 
 
INTEGER
ID
The group id.
Output:
 
 
STRING
name[31]
The name of the specified group.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Example:
integer gr_id
dump db_get_current_group_id(gr_id)
$# INTEGER  = 0
string name[32]
dump db_get_group_name(gr_id,name)
$# INTEGER  = 0
dump name
$# STRING name[32] = "default_group"