# Get Rooms from linked model in specified views

**URL:** <https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408>\
**Category:** Revit\
**Tags:** revit, python, geometry, dynamo\
**Created:** [February 16, 2022, 4:40pm UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408 "2022-02-16T16:40:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 16, 2022, 4:40pm UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/1 "2022-02-16T16:40:00Z")

</div>

Hi, all!

I am trying to create a script for our electrical engineers, that takes all Rooms from linked architectural model and tags them in a given view. I was just wondering if someone might think of a simple workflow to do this…

Currently, I am doing the following:

1. Get the linked Instance
2. Set the views I want to tag all the Rooms in
3. Get the view’s levels and match them with the ones from the link
4. Get all the Rooms from these levels, recreate their geometry and transform their coordinates
5. Check wether that geometry sits within the crop view limits and filter all the rooms, based on that
6. Tag filtered rooms in the specified views

Since my workflow depends on lots of geometric operations, It will probably be quite slow when dealing with numerous rooms and views, so I was just hoping someone might have a more clever idea 🙂

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [February 16, 2022, 9:26pm UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/2 "2022-02-16T21:26:42Z")

</div>

Hi!

What do you have so far?🙂

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 17, 2022, 7:54am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/3 "2022-02-17T07:54:01Z")

</div>

Sorry, I should have uploaded the graph as well. Here it is 🙂

[Tag Rooms from Linked Arch.dyn](https://forum.dynamobim.com/uploads/short-url/jddbMLWYYMRAqNrznJomn37oGZQ.dyn) (159.9 KB)

It was made in Revit 2021 and Dynamo 2.6

I have come to the point of filtering rooms by the matching levels and getting their geometry in order to check which are visible in the selected views. I have tried to do that with the isVisible node, but it seems like it does not work for elements from links. Basically, it’s almost ready now, I was just looking for a workflow that would work faster. To select the architectural link and the views you want tagged, I have used data shapes

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 17, 2022, 9:09am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/4 "2022-02-17T09:09:29Z")

</div>

Now I noticed Genius Loci’s Create Tag node might already provide a good solution for this. I will try it out

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [February 17, 2022, 9:16am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/5 "2022-02-17T09:16:08Z")

</div>

I’m working on you’re script, a tip: use category by name because the different versions can change the category:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/a/eaade60d41ceaaf1044742448e056db5a82d95c8.png)

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [February 17, 2022, 9:27am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/6 "2022-02-17T09:27:50Z")

</div>

Is this what you need?

I created a group with the ask why you need that.  
[Tag Rooms from Linked Arch.dyn](https://forum.dynamobim.com/uploads/short-url/ezwWfyGW8I2pWROHKip7V3Aod7j.dyn) (129.1 KB)

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 17, 2022, 9:36am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/7 "2022-02-17T09:36:38Z")

</div>

Thx for the quick reaction 🙂 However, it does not work at the moment, as the node SelectByCategoryInHostView does not return rooms from links:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/9/89a68fc2ef711b292fba374d6834f9c68b91ecea.png)

That’s what I tried first and it’s also the reason I went into this “why you need that workaround”

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [February 17, 2022, 9:41am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/8 "2022-02-17T09:41:18Z")

</div>

It works fine for me 🙂

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [February 17, 2022, 9:41am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/9 "2022-02-17T09:41:55Z")

</div>

Hello @danail.momchilov …here is a way with Datashapes and Genius Loci…probably it could work…

 ![Screenshot 2022-02-17 104014](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/7/57c346027aa412d6891753d59b289a1415e7d08d.png)

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 17, 2022, 10:01am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/10 "2022-02-17T10:01:24Z")

</div>

I thought this might be cause I am using a different version of Genius Loci, but it’s still the same after I updated it 🙂

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 17, 2022, 10:30am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/11 "2022-02-17T10:30:21Z")

</div>

yes, that worked! Thx a lot, it’s much more elegant than my solution… What I find weird is the Create Tag node still returns an error:

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

But all of the rooms are tagged, so it’s not that important:

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

It tagged 10 Floorplans in about 2 seconds, so it works quite fast also 🙂

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [February 17, 2022, 10:33am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/12 "2022-02-17T10:33:18Z")

</div>

Allright…check for unbounded and unplaced rooms…here i use dataskapes…

 ![Screenshot 2022-02-17 113237](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/5/35dd391922df5c8aa86e3e62df2ab9700a63d3a3.png)

When we use unbounded rooms node from data shapes the link element from bimorph isnt needed…here just use ootb nodes…

 ![Screenshot 2022-02-17 114437](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/4/74d084888ce18843a6064a653308aeac51ba6c02.png)

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 17, 2022, 2:43pm UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/13 "2022-02-17T14:43:37Z")

</div>

Actually, once I do this, it stops tagging elements, even though It reports that tags are placed. So I used Room Status node only to filter the Rooms list:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/6/669fa2b4620cc8cfabf539c7976506aa4b967191.png)

Only then I noticed it actually tags all rooms in all views, even though I chose only two:

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/1/21bded8d89c662014f43e3b0ae3e9880dd898e46.png)

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

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [February 18, 2022, 6:49am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/14 "2022-02-18T06:49:20Z")

</div>

Hello…dont know what goin on there…but try this one here…Just in case be sure you had room bounding on as her

 ![Screenshot 2022-02-18 075013](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/e/fe4fb5d7f7ba347d7440ff617b57d986bda5102a.png)

 ![Screenshot 2022-02-18 074731](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/6/a6b0a0805d4006fba66aaf43bb1cba0120594f7f.png)

[TAG ROOMS LINK.dyn](https://forum.dynamobim.com/uploads/short-url/oTpMkaV2v34IYMbx0SvYneo8i9Q.dyn) (39.1 KB)

PS…do you really have 3300 rooms ? from Arch

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [February 18, 2022, 8:40am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/15 "2022-02-18T08:40:14Z")

</div>

> PS…do you really have 3300 rooms ? from Arch

I thought the same 🤣

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [February 18, 2022, 8:42am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/16 "2022-02-18T08:42:33Z")

</div>

Yeps a very huge project i guess 😉

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 18, 2022, 8:50am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/17 "2022-02-18T08:50:47Z")

</div>

Thx for your answer again 🙂 Yes, links are Room Bounding and unfortunattely, with your version of the scrypt it still does not tag any rooms, even though it reports that it does. I guess it has to do with coordinates, cause links are typically placed by shared coordinates in our case. Perhaps that is why when you use Linkelement.Location it gets the right one. I guess I would need to dig in the code of Create Independent Tag node

About the rooms - yes, they are that many.

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

It’s a residential project with lots of small rooms and we even have much bigger ones… That’s why we need that scrypt 🙂 I will try to replicate the issue in a small sample file

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [February 18, 2022, 8:57am UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/18 "2022-02-18T08:57:40Z")

</div>

Allright…big project 😉 no matter you work in shared coordinates or not make sure all models share origin (just give an easier life 😉 and you had aqured the coordinates…

Yeps try to run on a sample and let me know how it works 😉

---

<div class="post-metadata">

**Author:** ![danail.momchilov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/danail.momchilov/32/152056_2.png) [@danail.momchilov](https://forum.dynamobim.com/u/danail.momchilov)\
**Post date:** [February 18, 2022, 12:26pm UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/19 "2022-02-18T12:26:19Z")

</div>

OK, I did a quick sample with 3 levels with 2 rooms each. I selected only Level 1 and Level 2 for the test. I got only those views tagged (unlike in the project), but I still see the graph reports that 12 rooms were placed:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/2/9245edbd3cd022e4506614441499b4b2d76b191f.png)

Once I select all room tags in the project, I really see they are 12. However, when I select all Visible in view for the two tagged views, I can only see two tags for each one, so 4 in total. I can’t really find where the other 8 are…

It seems like the node always tags all rooms, multiplied by the number of views you specified

I got the same result with your graph also. Here are the sample files I used: [WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free](https://we.tl/t-GDl6bCPD1S)

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [February 18, 2022, 12:56pm UTC](https://forum.dynamobim.com/t/get-rooms-from-linked-model-in-specified-views/73408/20 "2022-02-18T12:56:56Z")

</div>

hello try something it works for me…i will take a look a deeper look on your file later…

 ![Screenshot 2022-02-18 135444](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/3/332db7ff9758fe17556b89b91e3a4a59cd76184a.png)

this here isnt so heavy as solids…i think 3300 rooms 😉 amazing…

 ![Screenshot 2022-02-18 151541](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/5/75e59a2f22db1527e0fad8b66aac40872738339d.png)
