RVTDocs.com
Namespace: Autodesk.Revit.DB

GroupType

Class
Description:
An element representing a group of elements that may be placed many times in a project or family.
Remarks:
Grouping elements is useful when you need to create entities that represent repeating layouts or are common to many building projects, such as hotel rooms, apartments, or repeating floors.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.Element
    Autodesk.Revit.DB.ElementType
      Autodesk.Revit.DB.GroupType
Syntax
public class GroupType : ElementType
Examples
public void GetInfo_GroupType(GroupType groupType)
{
    string message = "GroupType";
    //Retrieve a set of all the groups that have this type.
    foreach (Group group in groupType.Groups)
    {
        // Get GroupType group name
        message = "\nThe group type name is : " + groupType.Name;
        //Returns all the members of the group.
        message += "\nThe types and ids of the group members are : ";
        IList<ElementId> groupMembers = group.GetMemberIds();
        foreach (ElementId memberId in groupMembers)
        {
            Element element = group.Document.GetElement(memberId);
            // Get GroupType group element id
            message += "\n\t" + element.GetType().Name + " : " + memberId.ToString();
        }
    }
    TaskDialog.Show("Revit",message);
}