<?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: Apply a saved view filter? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6018994#M67878</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can use a FilteredElementCollector to get the FillPatternElement you need.&lt;/P&gt;&lt;P&gt;When iterating over the FillPatternElements, you can get the solid one by its FillPattern.IsSolidFill property.&lt;/P&gt;&lt;P&gt;(Its FillPattern can be got by FillPatternElement.GetFillPattern()).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2016 08:07:45 GMT</pubDate>
    <dc:creator>Revitalizer</dc:creator>
    <dc:date>2016-02-02T08:07:45Z</dc:date>
    <item>
      <title>Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6015106#M67874</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a bunch of filter conditions (about 75) that I need to configure for a given view, with certain parameters. I'm thinking this should be fairly simple via the API. Basically the process is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Add my pre-constructed view filters to the current view (Vis/Graph -&amp;gt; Filters -&amp;gt; Add)&lt;/P&gt;&lt;P&gt;2. Configure the visibility overrides for each filter (Filters - &amp;gt; Overrides)&lt;/P&gt;&lt;P&gt;3. Done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, first question is: if I have a saved filter, say "Myfilter", how do I add it to the current view? I know it's via view.addfilter(), but I can't figure out how to get the ElementID parameter addfilter takes, for my filter based on its name. Or how to get a list (Ilist?) of the view filters available in the model, through which you could iterate and test for your desired name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second question, it would seem like an attractive option to simply create the filters I need from scratch. I've seen several examples in the SDK that cover creating view filters. Except that most of the examples simply filter on a built-in parameter (for example filter all the walls in the model). The parameter I need to filter on is a user-defined project parameter (not shared tho). How would you go about creating a filter based on one of these user-defined parameters?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 00:11:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6015106#M67874</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-30T00:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6015164#M67875</link>
      <description>I'd probably start with digging into this sample:&lt;BR /&gt;SDKs\Revit 2016\Samples\ElementFilter\ViewFilters&lt;BR /&gt;&lt;BR /&gt;Most of what you're looking for is in there, including code to find all view filters.&lt;BR /&gt;</description>
      <pubDate>Sat, 30 Jan 2016 01:51:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6015164#M67875</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-30T01:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6017679#M67876</link>
      <description>Ok, I've managed to start manipulating visibility and filter parameters. Unfortunately I can't figure out how to set a certain filter to a solid fill pattern.&lt;BR /&gt;&lt;BR /&gt;I'm iterating through the list of filters in the current view and using:&lt;BR /&gt;&lt;BR /&gt;mygraphicsoverride.SetCutFillPatternId(....);&lt;BR /&gt;&lt;BR /&gt;But, I can't figure out what to apply at "..." to get it to use a solid fill pattern. Any ideas?</description>
      <pubDate>Mon, 01 Feb 2016 16:31:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6017679#M67876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-01T16:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6018921#M67877</link>
      <description>&lt;P&gt;+ Id {4} Autodesk.Revit.DB.ElementId&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I think 4 of {4} will do the trick ....&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 07:03:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6018921#M67877</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-02T07:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6018994#M67878</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can use a FilteredElementCollector to get the FillPatternElement you need.&lt;/P&gt;&lt;P&gt;When iterating over the FillPatternElements, you can get the solid one by its FillPattern.IsSolidFill property.&lt;/P&gt;&lt;P&gt;(Its FillPattern can be got by FillPatternElement.GetFillPattern()).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 08:07:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6018994#M67878</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2016-02-02T08:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6018996#M67879</link>
      <description>&lt;P&gt;Dim TestCollector As New FilteredElementCollector(m_uidoc.Document)&lt;BR /&gt;Dim TestIterator As FilteredElementIterator = TestCollector.OfClass(GetType(FillPatternElement)).GetElementIterator&lt;BR /&gt;TestIterator.Reset()&lt;/P&gt;&lt;P&gt;For Each fp As FillPatternElement In TestCollector&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my case the solid fill returned integer = 4&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 08:10:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6018996#M67879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-02T08:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019005#M67880</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An ElementId can vary between different documents, so your value of "4" will probably not work for him.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 08:15:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019005#M67880</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2016-02-02T08:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019014#M67881</link>
      <description>&lt;P&gt;Absolutely true. I realised that also and therefore I provided a little code. You can find the ElementId by looking for a FillPatern named 'Solid fill'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim TestCollector As New FilteredElementCollector(m_uidoc.Document)&lt;BR /&gt;Dim TestIterator As FilteredElementIterator = TestCollector.OfClass(GetType(FillPatternElement)).GetElementIterator&lt;BR /&gt;TestIterator.Reset()&lt;/P&gt;&lt;P&gt;For Each fp As FillPatternElement In TestCollector&lt;BR /&gt;If fp.Name.ToString = "Solid fill" Then&lt;BR /&gt;Dim elementId As ElementId = fp.Id&lt;BR /&gt;Exit For&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 08:29:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019014#M67881</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-02T08:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019104#M67882</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;no need to get an Element &lt;EM&gt;by comparison of names&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;As I've written above, there is an IsSolidFill property which allows to get it language-independent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 09:46:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019104#M67882</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2016-02-02T09:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019115#M67883</link>
      <description>Didn't realise that. And it works fine too. Now I have to remember that for the next time I need it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Tue, 02 Feb 2016 09:52:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019115#M67883</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-02T09:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a saved view filter?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019729#M67884</link>
      <description>&lt;P&gt;What's with all the FilterElementCollectors in the Revit API? Seems everything revolves around a collector and a whole bunch of type conversions and obscure class members. I'm surprised commenting out code&amp;nbsp;doesn't require a collector!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couldn't Autodesk&amp;nbsp;just have defined a built in&amp;nbsp;constant called "FILLPATTERN_SOLID" or something? Would have turned out a whole lot easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 14:55:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-a-saved-view-filter/m-p/6019729#M67884</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-02T14:55:15Z</dc:date>
    </item>
  </channel>
</rss>

