Group tables store the list of groups in a Rhino document.

Properties

ComponentType

#Since v6.0
public override ModelComponentType ComponentType { get; }

Count

Returns the count of all items, including deleted ones.
public virtual int Count { get; }
inherited fromCommonComponentTable<T>

Document

Document that owns this table.
public RhinoDoc Document { get; }
inherited fromRhinoDocCommonTable<T>

Indexers

this[]

#Since v8.5
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.
public Group this[
index
zero based array index.
] { get; }
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

Add

#Since v5.0
Adds a new empty group to the group table.
public int Add()
Remarks: In some cases, calling Add() can cause the group indices to become invalid.
>=0 index of new group. -1 group not added because a group with that name already exists.

Add

#ExampleSince v5.0
Adds a new group to the group table with a set of objects.
public int Add(
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.
>=0 index of new group.

-1 group not added because a group with that name already exists.

Add

#Since v5.0
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.
>=0 index of new group.

-1 group not added because a group with that name already exists.

Add

#Since v5.0
Adds a new empty group to the group table.
public int Add(
groupName
name of new group.
)
Remarks: In some cases, calling Add() can cause the group indices to become invalid.
>=0 index of new group. -1 group not added because a group with that name already exists.

AddToGroup

#Since v5.0
Adds an object to an existing group.
public bool AddToGroup(
groupIndex,
The group index value.
objectId
An ID of an object.
)
true if the operation was successful.

AddToGroup

#Since v5.0
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.
)
true if at least an operation was successful.

ChangeGroupName

#
Changes the name of a group.
public bool ChangeGroupName(
groupIndex,
The index of the group.
newName
The new group name.
)
true if successful, false otherwise.

Clear

Marks all items as deleted.
public void Clear()
inherited fromCommonComponentTable<T>

Delete

#Since v6.0
public override bool Delete(
item
)

Delete

#Since v5.0
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.

public bool Delete(
groupIndex
An group index to be deleted.
)
true if the operation was successful.

Find

#Since v5.0 Obsolete v6.0
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.
>=0 index of the group with the given name. -1 no group found with the given name.

Find

#Since v6.0
Finds a group with a given name.
[Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] public int Find(
groupName
Name of group to search for. Ignores case.
)
>=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.
public virtual T FindId(
id
ID of model component to search for.
)
inherited fromCommonComponentTable<T>
Reference to the rhino object with the objectId or null if no such object could be found.
FindId

FindIndex

#Since v6.0
Retrieves a Group object based on Index. This search type of search is discouraged. We are moving towards using only IDs for all tables.
public Group FindIndex(
index
The index to search for.
)
A Group object, or null if none was found.

FindName

#Since v6.0
Finds a group given its name. Returns the instance, rather than the index.
public Group FindName(
name
The name of the group to be searched.
)
An group, or null on error.

FindNameHash

#Since v6.0
Finds a group given its name hash.
public Group FindNameHash(
nameHash
The name hash of the group to be searched.
)
An group, or null on error.

GetEnumerator

Returns the enumerator that yields all items.
public virtual IEnumerator<T> GetEnumerator()
inherited fromCommonComponentTable<T>

GroupMembers

#Since v5.0
Gets an array of all of the objects in a group.
public RhinoObject[] GroupMembers(
groupIndex
The index of the group in this table.
)
An array with all the objects in the specified group.

GroupName

#Since v5.0
Returns the name of a group.
public string GroupName(
groupIndex
The index of the group.
)
The group name.

GroupNames

#Since v5.0
Returns an array of all group names.
public string[] GroupNames(
ignoreDeletedGroups
Ignore any groups that were deleted.
)
An array if group names if successful, null if there are no groups.

GroupObjectCount

#Since v5.0
Returns the number of objects that are members of a group.
public int GroupObjectCount(
groupIndex
The index of the group.
)
The number of objects that are members of the group.

Hide

#Since v5.0
Hides all objects that are members of a group.
public int Hide(
groupIndex
The index of the group.
)
The number of objects that were hidden.

IsDeleted

#
Verifies a group is deleted.
public bool IsDeleted(
groupIndex
The index of the group.
)
true if the group is deleted, false otherwise.

Lock

#Since v5.0
Locks all objects that are members of a group.
public int Lock(
groupIndex
The index of the group.
)
The number of objects that were locked.

PurgeUnused

#Since v9.0
Purges any unused groups.
public int PurgeUnused()
The number of unused groups that were purged.

RemapObjects

#Since v8.16
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.
The number of Rhino objects that were modified.

RemapObjects

#Since v8.16
Remaps an enumeration of Rhino objects to new groups.
public int RemapObjects(
rhinoObjects
The enumeration of Rhino objects.
)
Remarks: In some situations, a bunch of Rhino objects are copied, new groups need to be created. This method handles the details.
The number of Rhino objects that were modified.

Show

#Since v5.0
Shows, or unhides, all objects that are members of a group.
public int Show(
groupIndex
The index of the group.
)
The number of objects that were shown.
Explicit

ICollection<Group>.Add

#
void ICollection<Group>.Add(
item
)

Undelete

#Since v5.0
Undeletes a previously deleted group.
public bool Undelete(
groupIndex
The index of the group.
)
true if successful, false otherwise.

Unlock

#Since v5.0
Unlocks all objects that are members of a group.
public int Unlock(
groupIndex
The index of the group.
)
The number of objects that were unlocked.