<?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: Find Views in which an element is visible (by geometry or actual visibility) in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6544640#M63382</link>
    <description>Hi Abba,&lt;BR /&gt;&lt;BR /&gt;Revit will open all the views and its going to take ALOT of time if you have alot of views within a complex project.&lt;BR /&gt;&lt;BR /&gt;I've just run into that problem and ended up here.&lt;BR /&gt;&lt;BR /&gt;Revit caches the results for a while so if you ask for the same thing one more time its going to go alot faster, but if you change your input, you are going to have to wait again.&lt;BR /&gt;&lt;BR /&gt;Im seeing times of 11 sek when Im going through 560 views.&lt;BR /&gt;I dont think the filteredelementcollector is designed with this in mind...&lt;BR /&gt;&lt;BR /&gt;If I find another way, I'll post it here.</description>
    <pubDate>Tue, 06 Sep 2016 15:00:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-09-06T15:00:50Z</dc:date>
    <item>
      <title>Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6522892#M63377</link>
      <description>&lt;P&gt;Here is what I would like to do:&lt;/P&gt;&lt;P&gt;Given any particular element (by extenstion, perhaps a set of elements):&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Find all views in the project in which the element is visible.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if I select a specific door, then I want to find all the floor plan views that include the door, plus section views that show the door (cut or projection), any elevation views that show the door, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without having given this too much work yet, it would seem that there are two general issues here, and I am guessing that Revit might deal with them differently:&lt;/P&gt;&lt;P&gt;a) given the geometric location of the element, does it occupy the space that is visible in any given view (considering clipping, etc)&lt;/P&gt;&lt;P&gt;b) given the visibility parameters, filters, etc - is the element shown/hidden due to its category, paramter, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my situation what I really would like to find at the moment is: If all visibility of all model elements is on, then what views would show the element.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for whatever clever insights people may have on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Abba Lustgarten&lt;/P&gt;&lt;P&gt;Abba CAD Abba Inc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 15:46:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6522892#M63377</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-25T15:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6524628#M63378</link>
      <description>&lt;P&gt;Dear Abba,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lucky you, asking the right question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This one, we can answer, and already have, including a dedicated external command&amp;nbsp;&lt;SPAN&gt;CmdViewsShowingElements&amp;nbsp;&lt;/SPAN&gt;to prove it to The Building Coder samples::&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/05/views-displaying-given-element-svg-and-nosql.html#6" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/05/views-displaying-given-element-svg-and-nosql.html#6&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/Revit-API/Revision-help-which-views-show-this-object/m-p/5029772" target="_blank"&gt;http://forums.autodesk.com/t5/Revit-API/Revision-help-which-views-show-this-object/m-p/5029772&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples" target="_blank"&gt;https://github.com/jeremytammik/the_building_coder_samples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdViewsShowingElements.cs" target="_blank"&gt;https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdViewsShowingElements.cs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let us know how it works for you and how you make use of this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&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>Fri, 26 Aug 2016 09:37:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6524628#M63378</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-08-26T09:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6531207#M63379</link>
      <description>&lt;P&gt;Jeremy&lt;/P&gt;&lt;P&gt;Thanks for your reference to the sample code and the brief history of this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your link:&amp;nbsp;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/05/views-displaying-given-element-svg-and-nosql.html#6" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/05/views-displaying-given-element-svg-and-nosql.html#6&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am just going to give this a try, and will let you know how it works for me.&lt;/P&gt;&lt;P&gt;As I do so, I just have this question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You mentioned that your initial solution for this involved looping through views and using a filteredelementcollector (with a view_ID parameter) to check for object visibility. &amp;nbsp;Colin pointed out the potential slowness of this, and your note implied&amp;nbsp;that he had come up with&amp;nbsp;what you considered to be a 'better way'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From my first glance, it looks to me like this sample also loops through a series of views and uses a view-specific filteredelementcollector to check for element visiblilty in each view. &amp;nbsp;I don't see your original code to compare, but I am wondering if Colin's code does in fact overcome the efficiency problem that he pointed out, or if he just found a better way to implement the approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am only asking to make sure I am not missing something, and to make sure I don't go too far down the wrong path as I am bringing my revit API skills up to speed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Abba Lustgarten&lt;/P&gt;&lt;P&gt;Abba CAD Abba Inc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 14:03:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6531207#M63379</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-30T14:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6531301#M63380</link>
      <description>&lt;P&gt;Dear Abba,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the blog post is pretty clear on that: "Here is the CmdViewsShowingElements implementation including Colin's two extension methods:..."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What more can I do to clarify?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note that the GitHub repo is maintained and contains the most up-to-date code.&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;</description>
      <pubDate>Tue, 30 Aug 2016 14:41:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6531301#M63380</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-08-30T14:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6531398#M63381</link>
      <description>Hi Jeremy,&lt;BR /&gt;&lt;BR /&gt;What I wanted to clarify was this:&lt;BR /&gt;&lt;BR /&gt;In the 'original' code, (which I haven't seen), Colin raised the concern&lt;BR /&gt;that when checking each view for element visibility, Revit would essentially&lt;BR /&gt;have to open the view and this could take a long time, especially if a lot&lt;BR /&gt;of views are being checked.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In the posted code, do you think this problem is overcome? Or would the&lt;BR /&gt;implementation of the filteredelementcollector still be 'opening' the views,&lt;BR /&gt;with the potential time problem.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In my case, I am likely to be looking at hundreds of views, so this could be&lt;BR /&gt;significant.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Practically speaking, as you advise, I am working on the assumption that the&lt;BR /&gt;github posted sample is most recently 'reccommended' approach. Thanks for&lt;BR /&gt;putting it there and helping me find it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your thoughts on this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Abba</description>
      <pubDate>Tue, 30 Aug 2016 15:09:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6531398#M63381</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-30T15:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6544640#M63382</link>
      <description>Hi Abba,&lt;BR /&gt;&lt;BR /&gt;Revit will open all the views and its going to take ALOT of time if you have alot of views within a complex project.&lt;BR /&gt;&lt;BR /&gt;I've just run into that problem and ended up here.&lt;BR /&gt;&lt;BR /&gt;Revit caches the results for a while so if you ask for the same thing one more time its going to go alot faster, but if you change your input, you are going to have to wait again.&lt;BR /&gt;&lt;BR /&gt;Im seeing times of 11 sek when Im going through 560 views.&lt;BR /&gt;I dont think the filteredelementcollector is designed with this in mind...&lt;BR /&gt;&lt;BR /&gt;If I find another way, I'll post it here.</description>
      <pubDate>Tue, 06 Sep 2016 15:00:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6544640#M63382</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-06T15:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6545535#M63383</link>
      <description>Hi erikeriksson5686,&lt;BR /&gt;&lt;BR /&gt;Thanks for your contribution for this,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So far, there isn't an alternative that I can see easily. It seems that the&lt;BR /&gt;key for me will probably be to 'pre-filter' the list of views that I want to&lt;BR /&gt;check.&lt;BR /&gt;&lt;BR /&gt;For example, by the name of the view, or by the type of view (only Floor&lt;BR /&gt;Plans, or Section Views, etc).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I built an interface that does this and gives me a list of 'eligible' views&lt;BR /&gt;and lets me select the ones I want to check for element visibility. This is&lt;BR /&gt;mostly for testing the whole mechanism at the moment, since I don't totally&lt;BR /&gt;trust the filter mechanism yet.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is all a bit preliminary, (got dragged off onto some other things.) but&lt;BR /&gt;I found that if I select something like a Stair, or a wall, it seems to&lt;BR /&gt;reliably find it in views. However I tried selecting some other things,&lt;BR /&gt;like a mullion on a curtain wall, etc, and that doesn't seem to register as&lt;BR /&gt;visible to the filtered element collector, even though it seems to be&lt;BR /&gt;visible in the view. If and when I find a more clear pattern, I will post&lt;BR /&gt;something about it, and if I don't, I will post something about it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As for the performance, I also noticed that 'cache' effect, so that running&lt;BR /&gt;the filter repeatedly on the same view is much faster.&lt;BR /&gt;&lt;BR /&gt;I am actually seeing the REVIT interface show me that it is regenerating the&lt;BR /&gt;view (at the bottom of the screen) when it is big and takes a while.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have a question for you,&lt;BR /&gt;&lt;BR /&gt;You mentioned 560 views taking 11 seconds. Did that mean 11 seconds to scan&lt;BR /&gt;all of them, or 11 seconds per view?&lt;BR /&gt;&lt;BR /&gt;i.e. are you getting through 50 views per second?&lt;BR /&gt;&lt;BR /&gt;I am looking at quite a large model with some fairly big and complex views,&lt;BR /&gt;but it is averaging a few views per second on small ones and a few seconds&lt;BR /&gt;per view on big ones.&lt;BR /&gt;&lt;BR /&gt;For my purposes, 11 seconds for 560 views would be ok.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Again, thanks for your contributions. I would be eager to hear if you have&lt;BR /&gt;something working well for you.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Abba Lustgarten&lt;BR /&gt;&lt;BR /&gt;Abba CAD Abba Inc.</description>
      <pubDate>Tue, 06 Sep 2016 20:28:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6545535#M63383</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-06T20:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6545568#M63384</link>
      <description>Ok, yes. Minimising the views are key, I also prefilter alot.&lt;BR /&gt;&lt;BR /&gt;Yes, the 11 sek are for all 560 views and thats the total time for prefiltering as well, so I might be getting little less than 10 seks for the views.&lt;BR /&gt;&lt;BR /&gt;However I might have found another way that looks really promising.&lt;BR /&gt;&lt;BR /&gt;By taking comparing BoundingBoxes of views and the target elements (intersections) I was able to get results in under a second for all views.&lt;BR /&gt;However, in constrast to the FilteredElementCollector way this requires some testing and setup to get accurate results.&lt;BR /&gt;You need to make sure that the view has cropping enabled and set correct height of the view boundingbox and some more.&lt;BR /&gt;Furthermore, I noticed viewsections needs some special care.&lt;BR /&gt;&lt;BR /&gt;I havent finished my tests, but like I said, it looks promising.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Sep 2016 20:47:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6545568#M63384</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-06T20:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6545593#M63385</link>
      <description>Does sound promising. I was planning on using the bounding box idea, but I&lt;BR /&gt;am somewhat new at the REVIT API, and have not dealt with the bounding box&lt;BR /&gt;of views yet. Somehow I suspect there is a level of complexity once you&lt;BR /&gt;factor in different coordinate systems (e.g. shared coordintates, etc?) view&lt;BR /&gt;clipping, floor level heights, etc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you have found some of these pitfalls, I would love to hear about them.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Good luck.</description>
      <pubDate>Tue, 06 Sep 2016 20:58:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6545593#M63385</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-06T20:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6546093#M63386</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for a valuable discussion, especially Erik with his in-depth real-world experience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The note on the huge speed-up using bounding boxes is of fundamental importance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You absolutely must be aware of the difference between quick and slow filters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The bounding box check is a quick filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quick filters&amp;nbsp;can be executed without regenerating the views and without fully loading the nitty-gritty detailed data of a huge model:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2015/12/quick-slow-and-linq-element-filtering.html#6" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2015/12/quick-slow-and-linq-element-filtering.html#6&lt;/A&gt;&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, 07 Sep 2016 05:03:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6546093#M63386</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-09-07T05:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6546403#M63387</link>
      <description>&lt;P&gt;Hi Jeremy,&lt;/P&gt;&lt;P&gt;actually Im not using the quick filter. I tried to, but the boundingbox of the views need altering because the Z values are not correct (for viewplans atleast). Im prefiltering alot with quick filters, but when it comes to the actual boundingbox comparision I've expanded the views into memory. You can see this in the code in the bottom.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I've perfected my boundingbox filter into something that works for me. I tried to get it to work in viewsections, but that was just too big of an obstacle for me today, the client didnt need that in the end, so I just skipped that part. The problem was figuring out the boundingbox since the coordinatesystem shifts in viewsections.&lt;BR /&gt;I tried to look a the transform of the boundingbox, and shift it accordingly, but it didnt work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you can shine some light on whats wrong or how to accomplish it, Jeremy?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The performance of the boundingbox version is extreme in comparison, using a stopwatch I measured the following times:&lt;BR /&gt;&lt;BR /&gt;~22 seks for the traditional way and 125 ms for the boundingbox way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, here is the extensionmethod I use now:&lt;BR /&gt;&lt;BR /&gt;Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: blue;"&gt;public&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;static&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;bool&lt;/SPAN&gt;&amp;nbsp;IntersectsBoundingBox(&lt;SPAN style="color: blue;"&gt;this&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;View&lt;/SPAN&gt;&amp;nbsp;view,&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;BoundingBoxXYZ&lt;/SPAN&gt;&amp;nbsp;targetBoundingBox)
{
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;var&lt;/SPAN&gt;&amp;nbsp;viewBoundingBox&amp;nbsp;=&amp;nbsp;view.CropBox;
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;if&lt;/SPAN&gt;&amp;nbsp;(!view.CropBoxActive)
&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;SPAN style="color: blue;"&gt;using&lt;/SPAN&gt;&amp;nbsp;(&lt;SPAN style="color: #2b91af;"&gt;Transaction&lt;/SPAN&gt;&amp;nbsp;tr&amp;nbsp;=&amp;nbsp;&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;Transaction&lt;/SPAN&gt;(view.Document,&amp;nbsp;&lt;SPAN style="color: #a31515;"&gt;"Temp"&lt;/SPAN&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: green;"&gt;//If&amp;nbsp;the&amp;nbsp;cropbox&amp;nbsp;is&amp;nbsp;not&amp;nbsp;active&amp;nbsp;we&amp;nbsp;cant&amp;nbsp;extract&amp;nbsp;the&amp;nbsp;boundingbox&amp;nbsp;(we&amp;nbsp;rollback&amp;nbsp;so&amp;nbsp;we&amp;nbsp;dont&amp;nbsp;change&amp;nbsp;anything&amp;nbsp;and&amp;nbsp;also&amp;nbsp;increase&amp;nbsp;performance)&lt;/SPAN&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;tr.Start();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;view.CropBoxActive&amp;nbsp;=&amp;nbsp;&lt;SPAN style="color: blue;"&gt;true&lt;/SPAN&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;viewBoundingBox&amp;nbsp;=&amp;nbsp;view.CropBox;
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tr.RollBack();
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;Outline&lt;/SPAN&gt;&amp;nbsp;viewOutline&amp;nbsp;=&amp;nbsp;&lt;SPAN style="color: blue;"&gt;null&lt;/SPAN&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;if&lt;/SPAN&gt;&amp;nbsp;(view&amp;nbsp;&lt;SPAN style="color: blue;"&gt;is&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;ViewPlan&lt;/SPAN&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;&lt;SPAN style="color: blue;"&gt;var&lt;/SPAN&gt;&amp;nbsp;viewRange&amp;nbsp;=&amp;nbsp;(view&amp;nbsp;&lt;SPAN style="color: blue;"&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;ViewPlan&lt;/SPAN&gt;).GetViewRange();
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: green;"&gt;//We&amp;nbsp;need&amp;nbsp;to&amp;nbsp;change&amp;nbsp;the&amp;nbsp;boundingbox&amp;nbsp;Z-values&amp;nbsp;because&amp;nbsp;they&amp;nbsp;are&amp;nbsp;not&amp;nbsp;correct&amp;nbsp;(for&amp;nbsp;some&amp;nbsp;reason).&amp;nbsp;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;var&lt;/SPAN&gt;&amp;nbsp;bottomXYZ&amp;nbsp;=&amp;nbsp;(view.Document.GetElement(viewRange.GetLevelId(&lt;SPAN style="color: #2b91af;"&gt;PlanViewPlane&lt;/SPAN&gt;.BottomClipPlane))&amp;nbsp;&lt;SPAN style="color: blue;"&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;Level&lt;/SPAN&gt;).Elevation&amp;nbsp;+&amp;nbsp;viewRange.GetOffset(&lt;SPAN style="color: #2b91af;"&gt;PlanViewPlane&lt;/SPAN&gt;.BottomClipPlane);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;var&lt;/SPAN&gt;&amp;nbsp;topXYZ&amp;nbsp;=&amp;nbsp;(view.Document.GetElement(viewRange.GetLevelId(&lt;SPAN style="color: #2b91af;"&gt;PlanViewPlane&lt;/SPAN&gt;.CutPlane))&amp;nbsp;&lt;SPAN style="color: blue;"&gt;as&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;Level&lt;/SPAN&gt;).Elevation&amp;nbsp;+&amp;nbsp;viewRange.GetOffset(&lt;SPAN style="color: #2b91af;"&gt;PlanViewPlane&lt;/SPAN&gt;.CutPlane);
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;viewOutline&amp;nbsp;=&amp;nbsp;&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;Outline&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;XYZ&lt;/SPAN&gt;(viewBoundingBox.Min.X,&amp;nbsp;viewBoundingBox.Min.Y,&amp;nbsp;bottomXYZ),&amp;nbsp;&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;XYZ&lt;/SPAN&gt;(viewBoundingBox.Max.X,&amp;nbsp;viewBoundingBox.Max.Y,&amp;nbsp;topXYZ));
&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;SPAN style="color: blue;"&gt;if&lt;/SPAN&gt;(!viewBoundingBox.Transform.BasisY.IsAlmostEqualTo(&lt;SPAN style="color: #2b91af;"&gt;XYZ&lt;/SPAN&gt;.BasisY))&amp;nbsp;&lt;SPAN style="color: green;"&gt;//this&amp;nbsp;is&amp;nbsp;where&amp;nbsp;I&amp;nbsp;try&amp;nbsp;to&amp;nbsp;hand&amp;nbsp;viewsections.&amp;nbsp;But&amp;nbsp;I&amp;nbsp;cant&amp;nbsp;get&amp;nbsp;it&amp;nbsp;to&amp;nbsp;work!!&lt;/SPAN&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;viewOutline&amp;nbsp;=&amp;nbsp;&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;Outline&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;XYZ&lt;/SPAN&gt;(viewBoundingBox.Min.X,&amp;nbsp;viewBoundingBox.Min.Z,&amp;nbsp;viewBoundingBox.Min.Y&amp;nbsp;),&amp;nbsp;&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;XYZ&lt;/SPAN&gt;(viewBoundingBox.Max.X,&amp;nbsp;viewBoundingBox.Max.Z,&amp;nbsp;viewBoundingBox.Max.Y&amp;nbsp;));
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
 
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;using&lt;/SPAN&gt;&amp;nbsp;(&lt;SPAN style="color: blue;"&gt;var&lt;/SPAN&gt;&amp;nbsp;boundingBoxAsOutline&amp;nbsp;=&amp;nbsp;&lt;SPAN style="color: blue;"&gt;new&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;Outline&lt;/SPAN&gt;(targetBoundingBox.Min,&amp;nbsp;targetBoundingBox.Max))
&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;SPAN style="color: blue;"&gt;return&lt;/SPAN&gt;&amp;nbsp;boundingBoxAsOutline.Intersects(viewOutline,&amp;nbsp;0);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
 
 
 
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I hope someone finds it useful and good luck Abba!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Erik&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2016 09:42:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6546403#M63387</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-07T09:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6546750#M63388</link>
      <description>Thank you Erik. I will hopefully soon have a chance to dig into this in&lt;BR /&gt;full. Right away, I can see a few major tricks that I am sure would have&lt;BR /&gt;taken me quite a while to uncover.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In particular, needing to make the cropbox active to get the bounding box,&lt;BR /&gt;and thus using a transaction and rolling it back in order to do this.&lt;BR /&gt;Question: if the cropping box is NOT active on a particular view, is the&lt;BR /&gt;bounding box really what reflects the visibility of an object in it?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;My gut told me that levels, transforms, etc would be necessary to filter&lt;BR /&gt;views according to their geometrical extents. This seems to have been&lt;BR /&gt;right, and I haven't gotten my hands very wet with those yet. Jeremy, can&lt;BR /&gt;you give a brief tutorial (or point to a sample or previous overview) on:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;- Bounding Boxes (views / elements)&lt;BR /&gt;&lt;BR /&gt;- Coordinate systems and their relationship to levels&lt;BR /&gt;&lt;BR /&gt;- Transformations of coordinates&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It turns out that section views are probably the most important for me, so&lt;BR /&gt;it would be great to have a 'universal' view extent calculator method.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It does make sense that filtering by the geometrical extents would be much&lt;BR /&gt;faster, even with slow filters, since we are considering the extents of only&lt;BR /&gt;a few objects (view, cropping box, element?), compared with many thousands&lt;BR /&gt;of elements that must be processed in some way when a view is actually&lt;BR /&gt;opened, as seems to happen when the filteredelementcollector goes at it.&lt;BR /&gt;However, I think it will be critical to make it work reliably on all&lt;BR /&gt;appropriate types of views.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks especially for the snippet. If and when I get this working, I will&lt;BR /&gt;post whatever extent-getter I come up with.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Abba</description>
      <pubDate>Wed, 07 Sep 2016 13:01:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6546750#M63388</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-07T13:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6546832#M63389</link>
      <description>Im glad you found some useful bits.&lt;BR /&gt;&lt;BR /&gt;I dont think that revit is using the boundingbox to calculate of the element is visible in the view, its far too slow for that (select element by id and press show, for instance...). Its just another way of doing it, maybe they dont do it because they too know they cant rely on the boundingbox extents and the fact that it must be turned on or maybe we'll see a much faster way of showing elements in the UI in the coming version of Revit =P&lt;BR /&gt;&lt;BR /&gt;Im sure there is a way of using this method with viewsections and from what I've seen, Jeremy is a whole lot better at this type of math than I am &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;By looking at the boundingbox of the viewsection its pretty clear that the Z values are messed up here to (or have some other meaning, that I cant comprehend).&lt;BR /&gt;&lt;BR /&gt;God, while writing this I started investigating alittle bit more.&lt;BR /&gt;I wrote a Room drawing generator last year and that had some heavy lifting when it came viewsections and figuring out and changing their cropboxes.&lt;BR /&gt;&lt;BR /&gt;This is a theory: but if you skip the original cropbox and use the "new" GetCropRegionShape using the CropManager. You get the crop in lines in project coordinates and then you can create a Solid by extrusion (using the far clip offset) using the GeometryCreationUtils and then use the SolidUtils and calculate solid intersections. That would probably be alot faster.&lt;BR /&gt;This has an obvious problem and that is that there could still be elements hiding your elements in the views. That is a problem I have in my boundingbox version to.&lt;BR /&gt;This is just me thinking out loud, there might be other problems with this workflow, what do you think, Jeremy?&lt;BR /&gt;&lt;BR /&gt;/Erik&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Sep 2016 13:29:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6546832#M63389</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-07T13:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Find Views in which an element is visible (by geometry or actual visibility)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6734366#M63390</link>
      <description>&lt;P&gt;Dear Abba and Erik,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry that I never answered your questions, guys, and left some open ends dangling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope we can resolve them by and by.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I published this discussion as it now stands, in the hope that others will want to discover, test and refine the approaches you suggested:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2016/12/determining-views-showing-an-element.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2016/12/determining-views-showing-an-element.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking forward to hearing what you think and what further progress you made in the meantime.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&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;</description>
      <pubDate>Wed, 07 Dec 2016 17:43:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/find-views-in-which-an-element-is-visible-by-geometry-or-actual/m-p/6734366#M63390</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-12-07T17:43:13Z</dc:date>
    </item>
  </channel>
</rss>

