Group tables store the list of groups in a Rhino document.
Properties
Indexers
Conceptually, the group table is an array of groups. The operator[] can be used to get individual groups. A group is either active or deleted and this state is reported by Group.IsDeleted.
Returns: Reference to the group. If index is out of range, null is returned. Note that this reference may become invalid after Add() is called.
Methods
Adds a new empty group to the group table.
Remarks: In some cases, calling Add() can cause the group indices to become invalid.
Returns: >=0 index of new group. -1 group not added because a group with that name already exists.
Adds a new group to the group table with a set of objects.
Remarks: In some cases, calling Add() can cause the group indices to become invalid.
Returns: >=0 index of new group.
-1 group not added because a group with that name already exists.
Adds a new group to the group table with a set of objects.
public int Add()
groupName,
Name of new group.
objectIds
An array, a list or any enumerable set of object IDs.
Remarks: In some cases, calling Add() can cause the group indices to become invalid.
Returns: >=0 index of new group.
-1 group not added because a group with that name already exists.
Adds a new empty group to the group table.
Remarks: In some cases, calling Add() can cause the group indices to become invalid.
Returns: >=0 index of new group. -1 group not added because a group with that name already exists.
Adds an object to an existing group.
Returns: true if the operation was successful.
Adds a list of objects to an existing group.
public bool AddToGroup()
groupIndex,
The group index value.
objectIds
An array, a list or any enumerable set of IDs to objects.
Returns: true if at least an operation was successful.
Clear
Marks all items as deleted.
public void Clear()
Deletes a group from this table.
Deleted groups are kept in the runtime group table so that undo will work with groups. Call IsDeleted() to determine if a group is deleted.
Returns: true if the operation was successful.
Finds a group with a given name.
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public int Find()
groupName,
Name of group to search for. Ignores case.
ignoreDeletedGroups
This parameter is ignored. Deleted groups are never searched.
obsoleteUse the overload without the ignoreDeletedGroups input. Note that the new method might return UnsetIntIndex.
Returns: >=0 index of the group with the given name. -1 no group found with the given name.
Finds a group with a given name.
Returns: >=0 index of the group with the given name. UnsetIntIndex no group found with the given name.
FindId
Uses the guid to find a model component. Deleted objects cannot be found by id. The guid is the value that is stored in the .Id property. In a single document, no two active objects have the same guid. If an object is replaced with a new object, then the guid persists. For example, if the _Move command moves an object, then the moved object inherits its guid from the starting object. If the Copy command copies an object, then the copy gets a new guid. This guid persists through file saving/opening operations. This function will not find grip objects.
Returns: Reference to the rhino object with the objectId or null if no such object could be found.
Implements: FindId
Retrieves a Group object based on Index. This search type of search is discouraged. We are moving towards using only IDs for all tables.
Returns: A Group object, or null if none was found.
Finds a group given its name. Returns the instance, rather than the index.
Returns: An group, or null on error.
Finds a group given its name hash.
Returns: An group, or null on error.
GetEnumerator
Returns the enumerator that yields all items.
Gets an array of all of the objects in a group.
Returns: An array with all the objects in the specified group.
Returns the name of a group.
Returns: The group name.
Returns an array of all group names.
Returns: An array if group names if successful, null if there are no groups.
Returns the number of objects that are members of a group.
Returns: The number of objects that are members of the group.
Hides all objects that are members of a group.
Returns: The number of objects that were hidden.
Locks all objects that are members of a group.
Returns: The number of objects that were locked.
Purges any unused groups.
Returns: The number of unused groups that were purged.
Remaps an enumeration of Rhino objects to new groups.
public int RemapObjects()
rhinoObjects,
The enumeration of Rhino objects.
indexMap
A map from old group indices to new group indices.
Remarks: In some situations, a bunch of Rhino objects are copied, new groups need to be created. This method handles the details.
Returns: The number of Rhino objects that were modified.
Remaps an enumeration of Rhino objects to new groups.
Remarks: In some situations, a bunch of Rhino objects are copied, new groups need to be created. This method handles the details.
Returns: The number of Rhino objects that were modified.
Shows, or unhides, all objects that are members of a group.
Returns: The number of objects that were shown.
Undeletes a previously deleted group.
Returns: true if successful, false otherwise.