Public Member Functions | List of all members
GroupList Class Reference

GroupList class is used to create a group of assembly parts.
The class can be called from Model class.
. More...

Public Member Functions

void AddPartToGroup (Variant &groupVal, Variant &val)
 Adds a part to a group that is specified by the part name or part ID. More...
 
void CreateGroup (String &groupName)
 Creates a blank group by specifying the name. More...
 
void CreateGroupByMaterial ()
 Groups parts with the same material.
 
void CreateGroupByName ()
 Groups parts with the same name.
 
void CreateGroupByNameStart (int characters)
 Groups parts with the first part of their names that match the specified number of characters. More...
 
void CreateGroupBySelected (Selection *selection, String &groupName)
 Groups parts selected by the Selection object by their specified name. More...
 
PartGroupGetGroup (Variant &var)
 Returns PartGroup object. More...
 
String GetGroupName (int groupIndex)
 Returns the name of the group for the specified index. More...
 
int GetPartId (Variant &val, int partIndex)
 Specifies a part in a group specified by its name or index by specifying the index in the group, and then returns the part ID. More...
 
Variant GetParts (Variant &var)
 Returns a list of parts from a specified group by specifying its name or ID. More...
 
bool IsValid ()
 Returns True if an object is valid. More...
 
int NumGroups ()
 Returns the number of groups as an integer. More...
 
int NumParts (Variant &var)
 Returns the number of parts in a group. More...
 
void RemoveAllGroups ()
 Removes all groups.
 
void RemoveGroup (Variant &var)
 Removes a group by specifying the group name. More...
 
void RemovePartFromGroup (Variant &groupVal, Variant &val)
 Removes a part from the specified group by specifying the part name or part ID. More...
 
void RenameGroup (Variant &var, String &newName)
 Changes the group name by specifying a new name and the old name. More...
 

Detailed Description

GroupList class is used to create a group of assembly parts.
The class can be called from Model class.
.

Example of obtaining the class object:

app.GetModel(0).GetGroupList()

Member Function Documentation

void GroupList::AddPartToGroup ( Variant &  groupVal,
Variant &  val 
)

Adds a part to a group that is specified by the part name or part ID.

Parameters
groupValGroup name
valPart name or ID
void GroupList::CreateGroup ( String &  groupName)

Creates a blank group by specifying the name.

Parameters
groupNameGroup name
void GroupList::CreateGroupByNameStart ( int  characters)

Groups parts with the first part of their names that match the specified number of characters.

Parameters
charactersNumber of characters
void GroupList::CreateGroupBySelected ( Selection selection,
String &  groupName 
)

Groups parts selected by the Selection object by their specified name.

Parameters
selectionSelection object (the selected parts)
groupNameGroup name
PartGroup * GroupList::GetGroup ( Variant &  var)

Returns PartGroup object.

Parameters
varPartGroup ID or name

For more information about PartGroup, see Part , PartGroup .

String GroupList::GetGroupName ( int  groupIndex)

Returns the name of the group for the specified index.

Parameters
groupIndexGroup index
Returns
Group name
int GroupList::GetPartId ( Variant &  val,
int  partIndex 
)

Specifies a part in a group specified by its name or index by specifying the index in the group, and then returns the part ID.

Parameters
valGroup name/Group index
partIndexPart index in the group
Returns
Part ID
Variant GroupList::GetParts ( Variant &  var)

Returns a list of parts from a specified group by specifying its name or ID.

Parameters
varGroup ID or name
Returns
Part list
bool GroupList::IsValid ( )

Returns True if an object is valid.

Returns
Whether or not the GroupList objects in the list are valid
int GroupList::NumGroups ( )

Returns the number of groups as an integer.

Returns
Number of groups
int GroupList::NumParts ( Variant &  var)

Returns the number of parts in a group.

Parameters
varGroup name or index
Returns
Number of parts
void GroupList::RemoveGroup ( Variant &  var)

Removes a group by specifying the group name.

Parameters
varGroup name
void GroupList::RemovePartFromGroup ( Variant &  groupVal,
Variant &  val 
)

Removes a part from the specified group by specifying the part name or part ID.

Parameters
groupValGroup name
valPart name/Part ID
void GroupList::RenameGroup ( Variant &  var,
String &  newName 
)

Changes the group name by specifying a new name and the old name.

Parameters
valOld group name
newNameNew group name