Getting all Elements of linked documents, visible in a View

Hi all, I am trying to get all the elements in a series of linked documents in Revit. I think I managed to get all the elements visible in the active documents, but when I tried to input the list of documents I get an error like:" the input is not a primary document".

I am sure there are various ways to get all the elements in view ( in my case a 3d view without template). One could be using the filter for the categories, like in this example

but I need a quick way to select all the visible categories in a View for different linked documents, without selecting them manually.

any suggestions?

The Active View component works on documents that are Open in Revit. Linked documents are only open as readonly and you can not open any of their views, sheets, etc.

Are you trying to query elements on a specific view inside a linked model?

hello Eshan,
thanks for the reply! that is exactly what I am trying to do, what is the most direct way to do that?

1 Like

If you place a ‘Query Views‘ component on the canvas and zoom in on it a + sign should become visible in the left side of the component.
If you click on it you can add a Document input parameter that will allow you to query views on the linked document as well.
Most of the components assume you are working on the active document but if is not the case like here you can pass an other document this way.

3 Likes

I was surely overcomplicating!

Thanks !

Is it possible to get linked objects (elements) within a given view?


I assume that the one above achieves getting elements from linked view which is different.

1 Like

That’s not possible via Revit API.

The primary workaround (see links below) is to get the views bounding box and cull the Elements not in the view box.

Make sense, thank you Japhy :+1:

Hi @hali1

the way I have been doing it to get the links visible in a specific view so far is like this: I compare the result of the Active View component with the Query Revit Links and from there I filter the links that are not visible in the view.

But if there is a scope box… then it will not work. Also, if you activate the Reveal Hidden Elements in Revit, the hidden links will show up in Rhino.

Linked documents in a view.gh (26.7 KB)



1 Like

Thank you @fcegnam, not sure if recompute can make the hidden links hidden again, but this is a smart solution!