Is there a method to return only visible elements within a view? The scenario is, I want to determine if a room (or room geometry) is visible in a 3d view.
‘All elements in active view’ returns elements which are ‘hidden’ by other elements. FilteredElementCollector and ‘Springs.Collector.ElementsInView’ also behaves the same.
I want to avoid any geometric calculations as these are often very slow.
Others have looked at using Tag all not tagged as a possible workaround. But this won’t work for rooms.
I would like to use rooms but it applies for any element. For example in this example, 2 rooms are visible, 2 are hidden (from sight). ‘All elements in active view’ doesn’t work on rooms but even if it did, it would return 4 elements, not two.
If it is possible, I’m sure it would require a lot of geometry. A perspective view would make more sense since you can do ray traces from the eye point shooting out.
Revit’s built in ray tracer (the ray bounce node) should be ok for this task, since it doesn’t involve any geometry conversion.
But if you want to try something else, you can override the colour of the elements in question into some bright red, or pink, or some other colour that you think will stick out. Then export the 3d view to a low res image and process its pixels with the built in image nodes. If the bright pink color is in the list of colors, then the elements are visible.
How exactly does the ray bounce node work? In terms of context (causing bounces of rays), does it take all the geometry in the model, or what is visible in current view? There doesn’t seem a way to specify it.
The example I am thinking of is a wall with a window turned off, so that a ray can pass through the opening and not be blocked by glass.
I don’t want to go down the image processing if possible. It’s Dynanimator right?