参考文献:http://adndevblog.typepad.com/aec/2014/01/hide-revit-group-via-api.html
public void hidegroup() { Document doc = this.ActiveUIDocument.Document; Selection sel = this.ActiveUIDocument.Selection; Reference ref1 = sel.PickObject(ObjectType.Element,"Please pick a group"); Element elem = doc.GetElement(ref1); IList<ElementId> lists = new List<ElementId>(); Group g = elem as Group; IList<ElementId> ids = g.GetMemberIds(); Transaction trans = new Transaction(doc); trans.Start("hidegroup"); this.ActiveUIDocument.ActiveView.HideElements(ids); trans.Commit (); }