<?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 How to filter elements through the Tab? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-filter-elements-through-the-tab/m-p/8277018#M47517</link>
    <description>&lt;P&gt;The title is&amp;nbsp;maybe&amp;nbsp;a little confusing. For example, I had a List&amp;lt;Element&amp;gt; &lt;STRONG&gt;elements&lt;/STRONG&gt;. As shown in the figure below, the &lt;STRONG&gt;System Tab&lt;/STRONG&gt; owns various element types: HVAC type, Fabrication type, Mechanical type, Piping type, Electrical type. I&lt;SPAN&gt;&amp;nbsp;need to classify the&lt;STRONG&gt; elements &lt;/STRONG&gt;list by these types. Is there any method to implement this?&amp;nbsp;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Revit.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/547707iA5E9981E1089C6CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Revit.png" alt="Revit.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Sep 2018 02:04:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-09-19T02:04:06Z</dc:date>
    <item>
      <title>How to filter elements through the Tab?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-filter-elements-through-the-tab/m-p/8277018#M47517</link>
      <description>&lt;P&gt;The title is&amp;nbsp;maybe&amp;nbsp;a little confusing. For example, I had a List&amp;lt;Element&amp;gt; &lt;STRONG&gt;elements&lt;/STRONG&gt;. As shown in the figure below, the &lt;STRONG&gt;System Tab&lt;/STRONG&gt; owns various element types: HVAC type, Fabrication type, Mechanical type, Piping type, Electrical type. I&lt;SPAN&gt;&amp;nbsp;need to classify the&lt;STRONG&gt; elements &lt;/STRONG&gt;list by these types. Is there any method to implement this?&amp;nbsp;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Revit.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/547707iA5E9981E1089C6CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Revit.png" alt="Revit.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 02:04:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-filter-elements-through-the-tab/m-p/8277018#M47517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-19T02:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter elements through the Tab?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-filter-elements-through-the-tab/m-p/8277399#M47518</link>
      <description>&lt;P&gt;Use &lt;STRONG&gt;FilteredElementCollector&lt;/STRONG&gt; to collect elements and get the type of the elements and with the help of the type classify the elements&lt;/P&gt;
&lt;PRE&gt; FilteredElementCollector Collector = new FilteredElementCollector(doc).WhereElementIsNotElementType();
                IList&amp;lt;ElementId&amp;gt; all_eids = Collector.ToElementIds() as IList&amp;lt;ElementId&amp;gt;;

                IList&amp;lt;ElementId&amp;gt; mech_ids = new List&amp;lt;ElementId&amp;gt;();
                IList&amp;lt;ElementId&amp;gt; elec_ids = new List&amp;lt;ElementId&amp;gt;();
                IList&amp;lt;ElementId&amp;gt; HVAC_ids = new List&amp;lt;ElementId&amp;gt;();
                IList&amp;lt;ElementId&amp;gt; piping_ids = new List&amp;lt;ElementId&amp;gt;();
                IList&amp;lt;ElementId&amp;gt; fabrication_ids = new List&amp;lt;ElementId&amp;gt;();

                foreach(ElementId eid in all_eids)
                {
                    Element e = doc.GetElement(eid);
                    Type T = e.GetType() as Type;
                    if(T.Name.Contains("Mechanical"))
                    {
                        mech_ids.Add(e.Id);
                    }
                    if(T.Name.Contains("Electrical"))
                    {
                        elec_ids.Add(e.Id);
                    }
                    if(T.Name.Contains("HVAC"))
                    {
                        HVAC_ids.Add(e.Id);
                    }
                    if(T.Name.Contains("Piping"))
                    {
                        piping_ids.Add(e.Id);
                    }
                    if(T.Name.Contains("Fabrication"))
                    {
                        fabrication_ids.Add(e.Id);
                    }

                }&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Sep 2018 07:31:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-filter-elements-through-the-tab/m-p/8277399#M47518</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2018-09-19T07:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter elements through the Tab?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-filter-elements-through-the-tab/m-p/8277816#M47519</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous,&lt;/P&gt;
&lt;P&gt;You can also approach by using with the below code&lt;/P&gt;
&lt;PRE&gt; FilteredElementCollector mech_coll = new FilteredElementCollector(doc).OfClass(typeof(MechanicalSystem)).WhereElementIsNotElementType();
                IList&amp;lt;ElementId&amp;gt; mech_ids = mech_coll.ToElementIds() as IList&amp;lt;ElementId&amp;gt;;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Sep 2018 10:36:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-filter-elements-through-the-tab/m-p/8277816#M47519</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2018-09-19T10:36:35Z</dc:date>
    </item>
  </channel>
</rss>

