public static List <RevitElements.Element> GetFiltersFromView(Revit.Elements.Element View) { DB.Document doc = DocumentManager.Instance.CurrentDBDocument; List <RevitElements.Element> filters = new List <RevitElements.Element>(); View _view = View.InternalElement as View; ICollection <ElementId> filterIds = _view.GetFilters(); List <DB.Element> parameterFilterElements = filterIds.Select(id => doc.GetElement(id)).ToList(); foreach (DB.Element pfe in parameterFilterElements) { ParameterFilterElement _pfe = pfe as ParameterFilterElement; filters.Add(_pfe.ToDSType(true)); } return(filters); }
public static List <RevitElements.Element> GetallFilters(bool Run) { if (!Run) { return(null); } DB.Document doc = DocumentManager.Instance.CurrentDBDocument; List <RevitElements.Element> filters = new List <RevitElements.Element>(); ICollection <ElementId> filterIds = new FilteredElementCollector(doc).OfClass(typeof(ParameterFilterElement)).ToElementIds(); List <DB.Element> parameterFilterElements = filterIds.Select(id => doc.GetElement(id)).ToList(); foreach (DB.Element pfe in parameterFilterElements) { ParameterFilterElement _pfe = pfe as ParameterFilterElement; filters.Add(_pfe.ToDSType(true)); } return(filters); }
public static List <RevitElements.Element> GetFiltersFromActiveView(bool Run) { if (!Run) { return(null); } DB.Document doc = DocumentManager.Instance.CurrentDBDocument; List <RevitElements.Element> filters = new List <RevitElements.Element>(); ICollection <ElementId> filterIds = doc.ActiveView.GetFilters(); List <DB.Element> parameterFilterElements = filterIds.Select(id => doc.GetElement(id)).ToList(); foreach (DB.Element pfe in parameterFilterElements) { ParameterFilterElement _pfe = pfe as ParameterFilterElement; filters.Add(_pfe.ToDSType(true)); } return(filters); }