Get linked geometry of multiple linked models

@kike @Japhy

Further to this post, if I have multiple linked models (which may be on BIM360), what is the best way to reference these elements and get their geometry?

Normally, I would use this method. But it is not scalable and components have to be copied multiple times if there are multiple linked model. Also not sure if this will work with BIM360.

The document links component returns a document, not a Revit link instance so not sure how to use it.

And getting element view geometry doesn’t return anything from a linked model.




@Japhy @kike
That only returns documents, not geometry.

If for example, I use a visibility filter with Query elements, it doesn’t return the geometry, just two random graphic styles…

Thanks for the files, that helps.

The only thing i did different was to de-centralized Building A & discard worksets

OK but that is not an option. I can’t discard worksets. Why would this be an issue? It hasn’t in the past.

Also, I need to get all elements in the view, not just walls.

Tomorrow i’ll open fresh and re-centralize and see if i can come up with anything.

I didn’t look too far but it appears you can’t get linked elements via the view filters, instead they recommend doing an intersect

It is not possible to create a filtered element collector where the document being filtered is a linked document, but the view being filtered is in the main document.

@Japhy any resolution to this?

Hi Paul, Everything is working as expected. The issue of not filtering the view is due to Revit API limitations on linked documents.

@Japhy I’m not sure why you are saying everything is working as expected as we don’t have a resolution yet.

Graphic elements is failing and de-centralising models is not an option.

Plus, my original question hasn’t been answered. That is, how can I get the geometry of linked elements in a view? If view filtering is an API limitation, what is the alternative?

For example, I could maybe do something like this, but I need to know what categories are visible in the active view rather than specifying a single category. Is this possible?

Not sure if this will even work as there may be multiple instances of the same document.

@kike mentioned design option visibility wasn’t available via the API so is this the same for category visibility?

You can query linked elements by category, but they don’t relate to the host view visibility. The recommendation that i’ve seen so far is to intersect/bounding box filter, although i haven’t had time to read through all the links here yet…

If I use a phase filter it returns all of the elements but then I would need to filter by category. Is there any easy way to select multiple categories (or even reference from a view template)?

Using a bounding box filter is only working on one of the linked files. I suspect it is because the bounding box doesn’t intersect Building B because of a different coordinate system. Not sure how this can be fixed.

Selecting the appropriate Categories and Union Filters seems applicable, if you know the categories ahead of time.

Or use the Elements coming out of the Phase Filter to create a Set of Categories more dynamically, if i’m understanding you correctly.

I have been messing with linked models and being able to query Geometry by View. Here is a new definition using the current daily build with update Link components. Is this what you are looking for?

I was able to grab all the geometry out of the links and get that in Rhino. Using the View to select the objects seems to be helpful:

1 Like

Hi @scottd. With this method, does all the geometry of the linked model come across?

What I was ultimately trying to do was get only the geometry that was visible in the view (so not including hidden categories or filtered elements).

Yes, the process seems to work for me. I do not see the things that are hidden in the view. In the example below I can switch between views in the linked model and the hidden objects will toggle on and off depending on the view that I use:

@scottd I’ve managed to replicate this and I just wanted to confirm something.

Your method is getting all of the geometry from a linked model based on the LINKED MODEL’S view, correct? So for this to work, each model would need to have the view setup and filters applied within that model.

What I was after was using the active’s model view settings (inc filters and hidden elements) to return the linked geometry. Does this make sense? It sounds like it might not be possible.

Still hasn’t been added to the Revit API as of 2022.1

Paul -

Due to the limitations in the Revit SDK, I think this does mean using a common view created in each of the linked models.

1 Like