/// <summary>
 /// From existing element
 /// </summary>
 /// <param name="instance"></param>
 /// <param name="isRevitOwned"></param>
 /// <returns></returns>
 internal static ParameterFilterElement FromExisting(Autodesk.Revit.DB.ParameterFilterElement instance, bool isRevitOwned)
 {
     return(new ParameterFilterElement(instance)
     {
         IsRevitOwned = isRevitOwned
     });
 }
Ejemplo n.º 2
0
        public static List <string> GetFilterRuleType(RevitElements.Element ParameterFilterElement)
        {
            DB.Document   doc             = DocumentManager.Instance.CurrentDBDocument;
            List <string> filterRulesType = new List <string>();

            DB.ParameterFilterElement parameterFilterElement = (DB.ParameterFilterElement)ParameterFilterElement.InternalElement;
            ElementLogicalFilter      elementFilter          = parameterFilterElement.GetElementFilter() as ElementLogicalFilter;

            IList <ElementFilter> efs = elementFilter.GetFilters();

            foreach (ElementFilter ef in efs)
            {
                ElementParameterFilter epf = ef as ElementParameterFilter;
                foreach (FilterRule r in epf.GetRules())
                {
                    if (r is FilterDoubleRule)
                    {
                        filterRulesType.Add("FilterDoubleRule");
                    }
                    else if (r is FilterStringRule)
                    {
                        filterRulesType.Add("FilterStringRule");
                    }
                    else if (r is FilterIntegerRule)
                    {
                        filterRulesType.Add("FilterIntegerRule");
                    }
                    else if (r is FilterGlobalParameterAssociationRule)
                    {
                        filterRulesType.Add("FilterGlobalParameterAssociationRule");
                    }
                    else if (r is FilterInverseRule)
                    {
                        filterRulesType.Add("FilterInverseRule");
                    }
                    else if (r is SharedParameterApplicableRule)
                    {
                        filterRulesType.Add("SharedParameterApplicableRule");
                    }
                }
            }
            return(filterRulesType);
        }
Ejemplo n.º 3
0
        public static List <string> GetFilterRuleMethod(RevitElements.Element ParameterFilterElement)
        {
            DB.Document   doc = DocumentManager.Instance.CurrentDBDocument;
            List <string> filterRulesEvaluatorType = new List <string>();

            DB.ParameterFilterElement parameterFilterElement = (DB.ParameterFilterElement)ParameterFilterElement.InternalElement;
            ElementLogicalFilter      elementFilter          = parameterFilterElement.GetElementFilter() as ElementLogicalFilter;

            IList <ElementFilter> efs = elementFilter.GetFilters();

            foreach (ElementFilter ef in efs)
            {
                ElementParameterFilter epf = ef as ElementParameterFilter;
                foreach (FilterRule r in epf.GetRules())
                {
                    string ruleMethod = FilterRuleMethod(CastFilterRule(r));
                    filterRulesEvaluatorType.Add(ruleMethod);
                }
            }
            return(filterRulesEvaluatorType);
        }
 /// <summary>
 /// Init ParameterFilterElement from existing
 /// </summary>
 /// <param name="element"></param>
 private void InitElement(Autodesk.Revit.DB.ParameterFilterElement element)
 {
     InternalSetElement(element);
 }
 /// <summary>
 /// ParameterFilterElement from existing
 /// </summary>
 /// <param name="elem"></param>
 private ParameterFilterElement(Autodesk.Revit.DB.ParameterFilterElement elem)
 {
     SafeInit(() => InitElement(elem));
 }
 /// <summary>
 /// Set the internal Element, ElementId, and UniqueId
 /// </summary>
 /// <param name="element"></param>
 private void InternalSetElement(Autodesk.Revit.DB.ParameterFilterElement element)
 {
     InternalRevitElement = element;
     InternalElementId    = element.Id;
     InternalUniqueId     = element.UniqueId;
 }
Ejemplo n.º 7
0
 public static Revit.Filter.ParameterFilterElement Wrap(Autodesk.Revit.DB.ParameterFilterElement ele, bool isRevitOwned)
 {
     return(Revit.Filter.ParameterFilterElement.FromExisting(ele, isRevitOwned));
 }