<?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 Apply the filter to the elements in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/apply-the-filter-to-the-elements/m-p/8925201#M40881</link>
    <description>&lt;P&gt;&lt;SPAN&gt;G'day all!&lt;/SPAN&gt;&lt;BR /&gt;im trying to figure out how can i copy value E.g. from one parameter to another but only for one category in my active document (E.g. walls)&lt;/P&gt;&lt;P&gt;when i find all Wall instances in my document and i apply the filter to the elements (using ElementCategoryFilter and FilteredElementCollector),&amp;nbsp; i dont know how can i easiest pick&amp;nbsp;only Elements from my list, not ElementIDs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;part of my code:&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;IList&amp;lt;Element&amp;gt; walls = collector.WherePasses(filter).WhereElementIsNotElementType().ToElements();&lt;/P&gt;&lt;P&gt;foreach (Element elem in walls)&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;Element e = doc.GetElement(elem);&amp;nbsp; &lt;/STRONG&gt;//in this line it gives me cannot convert type Element to ElementID&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt;{&lt;BR /&gt;Parameter p = e.get_Parameter ...&lt;/P&gt;&lt;P&gt;p.Set (....&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2019 11:04:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-23T11:04:38Z</dc:date>
    <item>
      <title>Apply the filter to the elements</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-the-filter-to-the-elements/m-p/8925201#M40881</link>
      <description>&lt;P&gt;&lt;SPAN&gt;G'day all!&lt;/SPAN&gt;&lt;BR /&gt;im trying to figure out how can i copy value E.g. from one parameter to another but only for one category in my active document (E.g. walls)&lt;/P&gt;&lt;P&gt;when i find all Wall instances in my document and i apply the filter to the elements (using ElementCategoryFilter and FilteredElementCollector),&amp;nbsp; i dont know how can i easiest pick&amp;nbsp;only Elements from my list, not ElementIDs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;part of my code:&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;IList&amp;lt;Element&amp;gt; walls = collector.WherePasses(filter).WhereElementIsNotElementType().ToElements();&lt;/P&gt;&lt;P&gt;foreach (Element elem in walls)&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;Element e = doc.GetElement(elem);&amp;nbsp; &lt;/STRONG&gt;//in this line it gives me cannot convert type Element to ElementID&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt;{&lt;BR /&gt;Parameter p = e.get_Parameter ...&lt;/P&gt;&lt;P&gt;p.Set (....&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 11:04:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-the-filter-to-the-elements/m-p/8925201#M40881</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-23T11:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Apply the filter to the elements</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/apply-the-filter-to-the-elements/m-p/8925271#M40882</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try using the below code&lt;/P&gt;
&lt;PRE&gt;IList&amp;lt;Element&amp;gt; walls = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType().ToElements() as IList&amp;lt;Element&amp;gt;;
                foreach(Element wall in walls)
                {
                    //Get element Directly
                    Element e = wall as Element;
                    Wall w = e as Wall;
                    /*
                     * Your code
                     */
                }&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Jul 2019 11:30:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/apply-the-filter-to-the-elements/m-p/8925271#M40882</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2019-07-23T11:30:55Z</dc:date>
    </item>
  </channel>
</rss>

