<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get all possible FilterRule parameters in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10936268#M20960</link>
    <description>&lt;P&gt;Hey Jeremy,&lt;/P&gt;&lt;P&gt;this is exactly what I am looking for! I wasn't aware of the "ParameterFilterUtilities" until now.&lt;/P&gt;&lt;P&gt;They seem to have some really useful methods for working with ViewFilters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I checked for which parameters are valid if the selected category is "walls".&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;List&amp;lt;string&amp;gt; parameterNames = new List&amp;lt;string&amp;gt;();
IList&amp;lt;ElementId&amp;gt; wallCatList = new List&amp;lt;ElementId&amp;gt;() { new ElementId(BuiltInCategory.OST_Walls) };
StringBuilder sb = new StringBuilder();

var paramColl = ParameterFilterUtilities.GetFilterableParametersInCommon(doc, wallCatList);

foreach (ElementId param in paramColl)
{
       BuiltInParameter bip = (BuiltInParameter)param.IntegerValue;
       string label = LabelUtils.GetLabelFor(bip);
       parameterNames.Add(label);
}

parameterNames.Sort();
parameterNames.ForEach(e =&amp;gt; sb.Append(e + "\r\n"));
TaskDialog.Show("Filtered Parameters", sb.ToString());&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the result is includes all built-in parameters which can be used for filtering:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GetFilterableParameters.jpg" style="width: 501px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1022286iA401E34FD24DB263/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GetFilterableParameters.jpg" alt="GetFilterableParameters.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":ok_hand:"&gt;👌&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Feb 2022 13:04:08 GMT</pubDate>
    <dc:creator>samuel_kreuz</dc:creator>
    <dc:date>2022-02-08T13:04:08Z</dc:date>
    <item>
      <title>Get all possible FilterRule parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10933670#M20954</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to create an application which automatically lists all possible ViewFilters for a given category.&lt;BR /&gt;E.g. for the category "walls" I would like to receive the parameters shown in the screenshot below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FilterRules.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1021754i3A1569350FB85797/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FilterRules.jpg" alt="FilterRules.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It seems like these filters are combinations of Project Parameters, Type Parameters and Instance Parameters.&lt;/P&gt;&lt;P&gt;Is there any way to collect all parameters which are allewed for creating a filter rule? Or at least a way to check if a parameter is valid for creating a filter rule?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Sam&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with Revit 2020&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 14:06:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10933670#M20954</guid>
      <dc:creator>samuel_kreuz</dc:creator>
      <dc:date>2022-02-07T14:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get all possible FilterRule parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10933840#M20955</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11672490"&gt;@samuel_kreuz&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You first can&amp;nbsp;Iterate and filter elements from a document to match the category you need.&amp;nbsp;&lt;SPAN&gt;The element filtering is performed by &lt;STRONG&gt;FilteredElementCollector&lt;/STRONG&gt; instances which are instantiated for a given document. e. if you want to get wall category&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FilteredElementCollector collector= new FilteredElementCollector(doc);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;collector.OfCategory(BuiltInCategory.OST_Walls);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;You then&amp;nbsp;&lt;SPAN&gt;Process the collector results using foreach statements and LINQ queries applying your custom filters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See details explained well in:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2010/06/parameter-filter.html" target="_blank" rel="nofollow noopener noreferrer"&gt;http://thebuildingcoder.typepad.com/blog/2010/06/parameter-filter.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2010/06/element-name-parameter-filter-correction.html" target="_blank" rel="nofollow noopener noreferrer"&gt;http://thebuildingcoder.typepad.com/blog/2010/06/element-name-parameter-filter-correction.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2009/12/parameter-filter-units.html" target="_blank" rel="nofollow noopener noreferrer"&gt;http://thebuildingcoder.typepad.com/blog/2009/12/parameter-filter-units.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 15:23:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10933840#M20955</guid>
      <dc:creator>caroline.gitonga</dc:creator>
      <dc:date>2022-02-07T15:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get all possible FilterRule parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10933863#M20956</link>
      <description>&lt;P&gt;I could be wrong here - and someone is welcome to correct me - but I'm assuming that list is more or less going to be the same as the available shared parameters on an element of that category. What you could try doing is using a FilteredElementCollector to grab the first item of the category, Walls in your example, get all the parameters with, and then filter through the parameter list for parameters where .IsShared is true.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 15:31:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10933863#M20956</guid>
      <dc:creator>stewart_skyler</dc:creator>
      <dc:date>2022-02-07T15:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get all possible FilterRule parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10933937#M20957</link>
      <description>&lt;P&gt;I asked the &lt;A href="https://autodesk.slack.com/archives/C0SR6NAP8/p1644249349284749" target="_blank" rel="noopener"&gt;devteam&lt;/A&gt; for you. Maybe they can add to the very valid suggestions above. Thank you,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11981988"&gt;@caroline.gitonga&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2156424"&gt;@stewart_skyler&lt;/a&gt;&amp;nbsp;!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 15:58:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10933937#M20957</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-02-07T15:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get all possible FilterRule parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10935702#M20958</link>
      <description>&lt;P&gt;I think the problem I am facing is that this filter rule parameter list does not only include shared and project parameters, but also some built-in parameters. As stewart.skyler and caroline.gitonga mentioned, I can loop through all shared parameters of a wall element and retreive only the shared ones.&lt;/P&gt;&lt;P&gt;When there are no shared parameters/project parameters defined, the list looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="list_with_no_shared_params.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1022153i9F74EBBBB7070C51/image-size/medium?v=v2&amp;amp;px=400" role="button" title="list_with_no_shared_params.jpg" alt="list_with_no_shared_params.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I filter out one wall-type from the project and grab its non-shared parameters, the output looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="all_not_shared_parameters_types.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1022155i98E91561881A1B20/image-size/medium?v=v2&amp;amp;px=400" role="button" title="all_not_shared_parameters_types.jpg" alt="all_not_shared_parameters_types.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see, it's not possible to filter for some parameters e.g. the "Coarse Scale Fill Color" parameter. So there are less parameters to filter than there are parameters available on the wall-type.&lt;BR /&gt;You can see that some paramters like "Area" and "Length" can not be found in the wall-type because they only make sense on an instanced object.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So if I filter after instances using "WhereElementIsNotElementType()" then the output is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="all_not_shared_parameters_instance.jpg" style="width: 501px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1022159i758A1064617D8087/image-size/medium?v=v2&amp;amp;px=400" role="button" title="all_not_shared_parameters_instance.jpg" alt="all_not_shared_parameters_instance.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question might actually be, what are the rules for the built-in elements to be included into the View Filter Parameter list and is there a way to find out which ones those are?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: the code I used to create the above lists:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;List&amp;lt;string&amp;gt; parametersShared = new List&amp;lt;string&amp;gt;();
List&amp;lt;string&amp;gt; parametersNotShared = new List&amp;lt;string&amp;gt;();

FilteredElementCollector col = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType();
            
var wall = col.FirstElement();
var wallParams = wall.Parameters;

foreach(Parameter param in wallParams)
{
        if (param.IsShared)
        {
            parametersShared.Add(param.Definition.Name + "\r\n");
        }
        else
        {
            parametersNotShared.Add(param.Definition.Name + "\r\n");
        }
}

parametersShared.Sort();
parametersNotShared.Sort();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 09:14:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10935702#M20958</guid>
      <dc:creator>samuel_kreuz</dc:creator>
      <dc:date>2022-02-08T09:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get all possible FilterRule parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10935787#M20959</link>
      <description>&lt;P&gt;The development team suggests taking a look at the&amp;nbsp;&lt;U&gt;ParameterFilterUtilities&lt;/U&gt; class, specifically&amp;nbsp;ParameterFilterUtilities.GetFilterableParametersInCommon:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2022/7ea624c7-2c0d-c9bb-3b2c-1ac798cf6606.htm" target="_blank" rel="noopener"&gt;https://www.revitapidocs.com/2022/7ea624c7-2c0d-c9bb-3b2c-1ac798cf6606.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does that help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 09:33:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10935787#M20959</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-02-08T09:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get all possible FilterRule parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10936268#M20960</link>
      <description>&lt;P&gt;Hey Jeremy,&lt;/P&gt;&lt;P&gt;this is exactly what I am looking for! I wasn't aware of the "ParameterFilterUtilities" until now.&lt;/P&gt;&lt;P&gt;They seem to have some really useful methods for working with ViewFilters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I checked for which parameters are valid if the selected category is "walls".&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;List&amp;lt;string&amp;gt; parameterNames = new List&amp;lt;string&amp;gt;();
IList&amp;lt;ElementId&amp;gt; wallCatList = new List&amp;lt;ElementId&amp;gt;() { new ElementId(BuiltInCategory.OST_Walls) };
StringBuilder sb = new StringBuilder();

var paramColl = ParameterFilterUtilities.GetFilterableParametersInCommon(doc, wallCatList);

foreach (ElementId param in paramColl)
{
       BuiltInParameter bip = (BuiltInParameter)param.IntegerValue;
       string label = LabelUtils.GetLabelFor(bip);
       parameterNames.Add(label);
}

parameterNames.Sort();
parameterNames.ForEach(e =&amp;gt; sb.Append(e + "\r\n"));
TaskDialog.Show("Filtered Parameters", sb.ToString());&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the result is includes all built-in parameters which can be used for filtering:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GetFilterableParameters.jpg" style="width: 501px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1022286iA401E34FD24DB263/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GetFilterableParameters.jpg" alt="GetFilterableParameters.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":ok_hand:"&gt;👌&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 13:04:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-possible-filterrule-parameters/m-p/10936268#M20960</guid>
      <dc:creator>samuel_kreuz</dc:creator>
      <dc:date>2022-02-08T13:04:08Z</dc:date>
    </item>
  </channel>
</rss>

