private string OutputSoft(Document doc) { List <FilteredElementCollector> collectors = new List <FilteredElementCollector>(_num_cates); for (int i = 0; i < _num_cates; ++i) { collectors.Add(new FilteredElementCollector(doc)); } ElementClassFilter familyInstanceFilter = new ElementClassFilter(typeof(FamilyInstance)); List <ElementCategoryFilter> filters = new List <ElementCategoryFilter>(_num_cates); filters.Add(new ElementCategoryFilter(BuiltInCategory.OST_FireAlarmDevices)); filters.Add(new ElementCategoryFilter(BuiltInCategory.OST_ElectricalEquipment)); filters.Add(new ElementCategoryFilter(BuiltInCategory.OST_CableTray)); //add more categories here for (int i = 0; i < _num_cates; ++i) { collectors[i].WherePasses(filters[i]).WherePasses(familyInstanceFilter); try { FPMana.CreateNewCategory((FamilyInstance)collectors[i].First()); foreach (FamilyInstance familyInstance in collectors[i]) { FPMana.AddInstance(familyInstance); } } catch { //no category-level nodes will be created if an exception is thrown ++_emptyCates; } } return((_num_cates - _emptyCates).ToString() + "\r\n" + FPMana.GetSoftReport()); }
private string OutputHard() { return(FPMana.GetHardReport(InterpretOUT2())); }