Elements visible in view

Hi

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.

Any suggestions?

By “visible in view” do you mean Revit’s interpretation of visible in view or if you can actually see it in a 3D view?

Revit’s select visible in view will still select items even if the actual geometry is blocked by another object, as long as it is there.

I mean, can it actually be seen, that is, not hidden by other geometry.

Like revealing all rooms in 3D view and hide everything else ?

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.

This is why I said I wanted to avoid any geometric calculations and was hoping there was an API command that would do this.

@Dimitar_Venkov any thoughts?

Its on Revit Idea, (rooms) so i guess not
Turn the geometry into Mass

Edit:
obviously i didn’t understand the question
sorry for that

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.

2 Likes

Hi Dimitar

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?