<?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: How to retrieve Rebar in link document in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9070451#M39450</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It looks like a very classical problem of Revit API, which is : you can not filter elements from a given view in a Linked document.&lt;/P&gt;&lt;P&gt;you can try the usual :&lt;/P&gt;&lt;PRE&gt;FilteredElementCollector collector = new FilteredElementCollector(linkedDocument, viewFromHostDocument);&lt;/PRE&gt;&lt;P&gt;And you will see Revit can not perform this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should probably try another way. For example, filter all the Rebar of the linked document, find the one closer to a given location. Pay attention to the Transformation between Host and Linked document though.&lt;/P&gt;&lt;P&gt;Good luck !&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2019 09:13:01 GMT</pubDate>
    <dc:creator>BenoitE&amp;A</dc:creator>
    <dc:date>2019-10-07T09:13:01Z</dc:date>
    <item>
      <title>How to retrieve Rebar in link document</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9063870#M39448</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I m trying retrieving Rebar in Link Document.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I create a solid from Cropt box of Active View (The second pic below) in Host Document. Then i used&amp;nbsp;ElementIntersectsSolidFilter to retrieve Elements in Link Document which intersect with Active View 's Solid.&lt;/P&gt;&lt;P&gt;But when i watch instanceElementsInViewRvL in debugging mode, there were no Rebar, only Floor and FamilyInstance..&lt;/P&gt;&lt;P&gt;I need some helps to retrieve Rebar in Link Document.&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;&lt;PRE&gt;var bbActiveView = ActiveView.get_BoundingBox(null);
var solidActivew = bbActiveView.CreateSolidFromBBox();
var solidIntersecFil = new Autodesk.Revit.DB.ElementIntersectsSolidFilter(solidActivew);
instanceElementsInViewRvL = new FilteredElementCollector(RevitLinkDocument)?.WhereElementIsNotElementType().WherePasses(solidIntersecFil);&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/683945i330364FF2713A4CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/683944iFD3849C15B234D8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kien&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 03:53:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9063870#M39448</guid>
      <dc:creator>kiencent94</dc:creator>
      <dc:date>2019-10-03T03:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve Rebar in link document</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9066712#M39449</link>
      <description>&lt;P&gt;Any help please&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kien&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 08:50:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9066712#M39449</guid>
      <dc:creator>kiencent94</dc:creator>
      <dc:date>2019-10-04T08:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve Rebar in link document</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9070451#M39450</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It looks like a very classical problem of Revit API, which is : you can not filter elements from a given view in a Linked document.&lt;/P&gt;&lt;P&gt;you can try the usual :&lt;/P&gt;&lt;PRE&gt;FilteredElementCollector collector = new FilteredElementCollector(linkedDocument, viewFromHostDocument);&lt;/PRE&gt;&lt;P&gt;And you will see Revit can not perform this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should probably try another way. For example, filter all the Rebar of the linked document, find the one closer to a given location. Pay attention to the Transformation between Host and Linked document though.&lt;/P&gt;&lt;P&gt;Good luck !&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 09:13:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9070451#M39450</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2019-10-07T09:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve Rebar in link document</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9072229#M39451</link>
      <description>&lt;P&gt;I tried to find all instance element in Link Document, then i used&amp;nbsp;ElementIntersectsSolidFilter to filter elements which intersects with a given solid (Solid from Cropt Box of ActiveView in Active Document).&lt;/P&gt;&lt;P&gt;As my code and 2 pictures i attached above, The solid of Active View in Active Document definitely intersects 3 element of Link Document (Rebars,Floor, Framing). But my code couldn't retrieve Rebar, just retrieve Floor and Framing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kien&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 02:29:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9072229#M39451</guid>
      <dc:creator>kiencent94</dc:creator>
      <dc:date>2019-10-08T02:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve Rebar in link document</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9075459#M39452</link>
      <description>&lt;P&gt;My guess is: your intersection is between elements from different documents. I mean: either your box is from HostDocument; or the Floors and Framing are from Host and Rebar from LinkedDocument...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another point: usually in Revit you have an option when you use methods like&amp;nbsp;&lt;SPAN&gt;ElementIntersectsSolidFilter&amp;nbsp;to search elements from the LinkedDocument and not only in the Host. Did you check this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 09:09:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9075459#M39452</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2019-10-09T09:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve Rebar in link document</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9076750#M39453</link>
      <description>Thank for your comments.&lt;BR /&gt;In my example , the box is from host document, Floor, FamilyInstance&lt;BR /&gt;(Framing), Rebars are from link document.&lt;BR /&gt;As my code ( first attached picture ) i used solid of Active View ( 2nd pic&lt;BR /&gt;) from Host Document to retrieve elements from Link Document (all element&lt;BR /&gt;in pic 2 are from Link Document) by ElementIntersectSolidFilter.&lt;BR /&gt;As u see in 1st pic, in debug mode, it just retrieved floor and framing,&lt;BR /&gt;not rebars...&lt;BR /&gt;Apologize for my english is not good.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Kien&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Oct 2019 17:15:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9076750#M39453</guid>
      <dc:creator>kiencent94</dc:creator>
      <dc:date>2019-10-09T17:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve Rebar in link document</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9077984#M39454</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Looks like you don't get it so I'll try to be clear :&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this line you create a filter based on a view from your Host Document :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var solidIntersecFil = new Autodesk.Revit.DB.ElementIntersectsSolidFilter(solidActivew);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;And here you use it hoping you can intersect elements from your Linked Document :&lt;/P&gt;&lt;PRE&gt;instanceElementsInViewRvL = new FilteredElementCollector(RevitLinkDocument)?.WhereElementIsNotElementType().WherePasses(solidIntersecFil);&lt;/PRE&gt;&lt;P&gt;Revit can not do this (filter stuff from a Linked Doc using a filter based on a view of the Host Doc).&lt;/P&gt;&lt;P&gt;So you have to find another way of thinking.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 07:35:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9077984#M39454</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2019-10-10T07:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve Rebar in link document</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9080350#M39455</link>
      <description>&lt;P&gt;If Revit couldn't do the filter as u said, so why did i retrieve Floor and Framing, both of this from Link Document. U could see these in the 1st pic (debugging mode).&lt;/P&gt;&lt;P&gt;I think u are misunderstanding, i dont use the method that search and filter visible element in &lt;STRONG&gt;a View&lt;/STRONG&gt; and &lt;STRONG&gt;a Document&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;public FilteredElementCollector
	 ( Document document,
	ElementId viewId )&lt;/PRE&gt;&lt;P&gt;I use another that search and filter the set of elements in a &lt;STRONG&gt;Document&lt;/STRONG&gt;:(Corresponding for my example is&amp;nbsp;&lt;STRONG&gt;LinkDocument)&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;public FilteredElementCollector
	( Document document )&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kien&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 03:44:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9080350#M39455</guid>
      <dc:creator>kiencent94</dc:creator>
      <dc:date>2019-10-11T03:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve Rebar in link document</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9080657#M39456</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Indeed you must be right and I must be wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solidActiveView (creating a solid from the view) is pretty clever and might avoid the problem that I mentionned, so all in all you should retrieve your Rebar.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would add a filter on categories to ease the search for Revit (since you know you are searching for Rebar) but still, your problem looks... odd.&lt;/P&gt;&lt;P&gt;Another way of trying to do it is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filter all the document on Rebar.&lt;/P&gt;&lt;P&gt;Localize your solidActiveView&lt;/P&gt;&lt;P&gt;Find the closest Rebar from the solidActiveView&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 08:05:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-rebar-in-link-document/m-p/9080657#M39456</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2019-10-11T08:05:01Z</dc:date>
    </item>
  </channel>
</rss>

