<?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 Get all elements from linked model. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6518991#M63404</link>
    <description>&lt;P&gt;I can get elements of type wall using this code snippet. But I need to get all types of element from link document. Can anyone please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foreach (Document linkedDoc in uiApp.Application.Documents)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (element.Name.Contains(linkedDoc.Title))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FilteredElementCollector linkElementCollector = new FilteredElementCollector(linkedDoc);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IList&amp;lt;Element&amp;gt; linkedWalls = linkElementCollector.OfClass(typeof(Wall)).ToElements(); &amp;nbsp; &amp;nbsp; // &amp;nbsp;&amp;lt;------------------Filter applied here.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (Element e in linkElementCollector)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2016 04:39:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-08-24T04:39:58Z</dc:date>
    <item>
      <title>Get all elements from linked model.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6518991#M63404</link>
      <description>&lt;P&gt;I can get elements of type wall using this code snippet. But I need to get all types of element from link document. Can anyone please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foreach (Document linkedDoc in uiApp.Application.Documents)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (element.Name.Contains(linkedDoc.Title))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FilteredElementCollector linkElementCollector = new FilteredElementCollector(linkedDoc);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IList&amp;lt;Element&amp;gt; linkedWalls = linkElementCollector.OfClass(typeof(Wall)).ToElements(); &amp;nbsp; &amp;nbsp; // &amp;nbsp;&amp;lt;------------------Filter applied here.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (Element e in linkElementCollector)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 04:39:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6518991#M63404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-24T04:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get all elements from linked model.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6519026#M63405</link>
      <description>&lt;P&gt;You can replace the filter for Wall instances by any other filter of your choice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want to filter for all elements, which is not recommended, you have to apply a little trick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That trick and many related&amp;nbsp;aspects are&amp;nbsp;explained here by The Building Coder:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&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, 24 Aug 2016 05:31:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6519026#M63405</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-08-24T05:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get all elements from linked model.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6519195#M63406</link>
      <description>&lt;P&gt;Thanks you very much and now I realised why it was not recommended to filter all elements because it returns each elements.&lt;/P&gt;&lt;P&gt;But my problem is I want to get elements from linked model and only physical entities available in linked model. Like Wall, floor etc. now the issue, it is not prefixed that how many types of elements available in linked model So I need to implement any generic method which retrieve all physical entities.&lt;/P&gt;&lt;P&gt;Here physical entities mean what I am seeing in linked model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;FilteredElementCollector linkElementCollector = new FilteredElementCollector(linkedDoc, View.Id);&lt;/P&gt;&lt;P&gt;But returns error that viewid is not view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks. &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 07:40:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6519195#M63406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-24T07:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get all elements from linked model.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6519247#M63407</link>
      <description>&lt;P&gt;Filtering for a view only works in the document that owns that view.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Building Coder has discussed the topic of retrieving model elements only numerous times. Look at the entries in the topic group I pointed you to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you look at that at all?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 08:10:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6519247#M63407</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-08-24T08:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get all elements from linked model.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6539003#M63408</link>
      <description>&lt;P&gt;Great. Thank you very much&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik﻿&lt;/a&gt;. You are awesome.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 12:48:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-all-elements-from-linked-model/m-p/6539003#M63408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-02T12:48:54Z</dc:date>
    </item>
  </channel>
</rss>

