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.
Parameters:
| index (int) | zero based array index. |
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.
Parameters:
| objectIds (IEnumerable<Guid>) | An array, a list or any enumerable set of object IDs. |
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.
Parameters:
| groupName (string) | Name of new group. |
| objectIds (IEnumerable<Guid>) | An array, a list or any enumerable set of object IDs. |
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.
Parameters:
| groupName (string) | name of new group. |
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.
Adds a list of objects to an existing group.
Parameters:
| groupIndex (int) | The group index value. |
| objectIds (IEnumerable<Guid>) | An array, a list or any enumerable set of IDs to objects. |
Returns: true if at least an operation was successful.
ChangeGroupName
#Changes the name of a group.
Clear
public void Clear()
Marks all items as deleted.
Parameters:
| item (Group) |
Overrides: CommonComponentTable<T>.Delete
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.
Parameters:
| groupIndex (int) | An group index to be deleted. |
Returns: true if the operation was successful.
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public int Find(string groupName, bool ignoreDeletedGroups)
obsoleteUse the overload without the ignoreDeletedGroups input. Note that the new method might return UnsetIntIndex.
Finds a group with a given name.
Finds a group with a given name.
Parameters:
| groupName (string) | Name of group to search for. Ignores case. |
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.
Retrieves a Group object based on Index. This search type of search is discouraged. We are moving towards using only IDs for all tables.
Parameters:
| index (int) | The index to search for. |
Returns: A Group object, or null if none was found.
Finds a group given its name. Returns the instance, rather than the index.
Parameters:
| name (string) | The name of the group to be searched. |
Returns: An group, or null on error.
Finds a group given its name hash.
Parameters:
| nameHash (NameHash) | The name hash of the group to be searched. |
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.
Parameters:
| groupIndex (int) | The index of the group in this table. |
Returns: An array with all the objects in the specified group.
Returns the name of a group.
Parameters:
| groupIndex (int) | The index of the group. |
Returns: The group name.
Returns an array of all group names.
Parameters:
| ignoreDeletedGroups (bool) | Ignore any groups that were deleted. |
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.
Parameters:
| groupIndex (int) | The index of the group. |
Returns: The number of objects that are members of the group.
Hides all objects that are members of a group.
Parameters:
| groupIndex (int) | The index of the group. |
Returns: The number of objects that were hidden.
IsDeleted
#Verifies a group is deleted.
Parameters:
| groupIndex (int) | The index of the group. |
Returns: true if the group is deleted, false otherwise.
Locks all objects that are members of a group.
Parameters:
| groupIndex (int) | The index of the 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.
Remarks: In some situations, a bunch of Rhino objects are copied, new groups need to be created. This method handles the details.
Parameters:
| rhinoObjects (IEnumerable<RhinoObject>) | The enumeration of Rhino objects. |
| indexMap (out Dictionary<int, int>) | A map from old group indices to new group indices. |
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.
Parameters:
| rhinoObjects (IEnumerable<RhinoObject>) | The enumeration of Rhino objects. |
Returns: The number of Rhino objects that were modified.
Shows, or unhides, all objects that are members of a group.
Parameters:
| groupIndex (int) | The index of the group. |
Returns: The number of objects that were shown.
Undeletes a previously deleted group.
Parameters:
| groupIndex (int) | The index of the group. |
Returns: true if successful, false otherwise.