# Extract linked Rooms visible in host view?

**URL:** <https://forum.dynamobim.com/t/extract-linked-rooms-visible-in-host-view/114879>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [July 1, 2026, 1:49pm UTC](https://forum.dynamobim.com/t/extract-linked-rooms-visible-in-host-view/114879 "2026-07-01T13:49:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amir.kharrat](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@amir.kharrat](https://forum.dynamobim.com/u/amir.kharrat)\
**Post date:** [July 1, 2026, 1:49pm UTC](https://forum.dynamobim.com/t/extract-linked-rooms-visible-in-host-view/114879/1 "2026-07-01T13:49:31Z")

</div>

Hello guys , is there a way to extract the rooms(from a linked document) that are visible in a host view project? i tried doing the bounding box intersection but as you can see the bounding box of the selected view is very far away from the rooms bounding boxes because of using scopeboxes, any other way?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/f/0f84885b065a7a2e5798322e71541c210161efab.png)

 ![RoomsVisibleInView](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/b/1beced99009c8f41c9a8ac532b9dc9b63f459293.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/7/879c749db31bd5e6b49ebd3eabe91f34499462c8.png)

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [July 2, 2026, 1:29am UTC](https://forum.dynamobim.com/t/extract-linked-rooms-visible-in-host-view/114879/2 "2026-07-02T01:29:45Z")

</div>

Try using the OOTB node _LinkInstance.AllElementsOfCategory_.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/3/439a729ded2a4d5bb1f1a0c843d279152387027e.png)

Try this python option

```python
import clr

clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager

clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Architecture import Room

def is_room_type(elem):
    return isinstance(elem, Room)

doc = DocumentManager.Instance.CurrentDBDocument

# Get link document with room by keyword in filename - NOTE: Case Sensitive
bip = ElementId(BuiltInParameter.ELEM_TYPE_PARAM)
pfrf = ParameterFilterRuleFactory.CreateContainsRule(bip, "Architect")
epf = ElementParameterFilter(pfrf)

link_instance = (
    FilteredElementCollector(doc)
    .OfClass(RevitLinkInstance)
    .WherePasses(epf)
    .FirstElement()
)
link_doc = link_instance.GetLinkDocument()

# Bounding Box Filter
crop_box = doc.ActiveView.CropBox
outline = Outline(crop_box.Min, crop_box.Max)
bb_inside = BoundingBoxIsInsideFilter(outline)
bb_intersects = BoundingBoxIntersectsFilter(outline)

# SpatialElement works with the primary DB and is recommended
rooms_inside = (
    FilteredElementCollector(link_doc)
    .OfClass(SpatialElement)
    .WherePasses(bb_inside)
    .ToElements()
)
rooms_intersects = (
    FilteredElementCollector(link_doc)
    .OfClass(SpatialElement)
    .WherePasses(bb_intersects)
    .ToElements()
)

OUT = filter(is_room_type, rooms_inside), filter(is_room_type, rooms_intersects)

```

---

<div class="post-metadata">

**Author:** ![BimAmbit](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bimambit/32/192629_2.png) [@BimAmbit](https://forum.dynamobim.com/u/BimAmbit)\
**Post date:** [July 2, 2026, 4:20am UTC](https://forum.dynamobim.com/t/extract-linked-rooms-visible-in-host-view/114879/3 "2026-07-02T04:20:49Z")

</div>

[FilteredElementCollector Class](https://www.revitapidocs.com/2024/968b52a0-de55-2f96-de40-968812bc41c7.htm)

If you are using rvt 24 or above, you can stop doing things the hard way since FilteredElementCollector now accepts a linkId.

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [July 2, 2026, 6:37am UTC](https://forum.dynamobim.com/t/extract-linked-rooms-visible-in-host-view/114879/4 "2026-07-02T06:37:37Z")

</div>

🤯  
Using a category filter is neater as well

```python
import clr

clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import (
    BuiltInCategory,
    BuiltInParameter,
    ElementId,
    ElementParameterFilter,
    FilteredElementCollector,
    ParameterFilterRuleFactory,
)

clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

active_view = doc.ActiveView.Id

# Get link document with rooms by keyword in filename - NOTE: Case Sensitive
bip = ElementId(BuiltInParameter.ELEM_TYPE_PARAM)
pfrf = ParameterFilterRuleFactory.CreateContainsRule(bip, "Architect")
epf = ElementParameterFilter(pfrf)

link_instance = (
    FilteredElementCollector(doc)
    .OfCategory(BuiltInCategory.OST_RvtLinks)
    .WherePasses(epf)
    .FirstElement()
    .Id
)

OUT = (
    FilteredElementCollector(doc, active_view, link_instance)
    .OfCategory(BuiltInCategory.OST_Rooms)
    .ToElements()
)

```

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [July 2, 2026, 2:28pm UTC](https://forum.dynamobim.com/t/extract-linked-rooms-visible-in-host-view/114879/5 "2026-07-02T14:28:24Z")

</div>

> [@amir.kharrat](#):
>
> i tried doing the bounding box intersection but as you can see the bounding box of the selected view is very far away from the rooms bounding boxes because of using scopeboxes, any other way?

Check whether your LinkInstance has a transformation (it’s likely that your architectural model isn’t linked origin-to-origin); if so, you must account for this transformation in your code to correctly reposition the Room Solids or Room bounding boxes.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [August 28, 2026, 1:43pm UTC](https://forum.dynamobim.com/t/extract-linked-rooms-visible-in-host-view/114879/6 "2026-08-28T13:43:06Z")

</div>

Split this topic on August 28, 2026, 1:43pm UTC

6 posts were merged into an existing topic: [Linked walls as elements in active view in dynamo](https://forum.dynamobim.com/t/linked-walls-as-elements-in-active-view-in-dynamo/115156/2)
