Automatically placing tags - Only place tags that are visible in view

Hi All,

I’ve created a dynamo script that adds room tags to selected floor plan views in a model. I’ve got to a point where I thought it was working great, but I’ve encountered a problem!

When I select all room tags in the model there are 101092. This is the number of floor plans (254) multiplied by the number of rooms in the model (398). This means room tags are placed for all rooms in the model in every floor plan view. There’s no way for me to see the room tags on the other levels, extending the view range doesn’t show them but they ARE there.

The script works by taking the Element.Location points of the rooms and applying them to each floor plan, but I only want it to tag the rooms that are visible in each view. Does anyone know if this is possible? I think it might require Python coding but I’m still a Dynamo novice, any pointers/advice would be much appreciated!



You could probably map the room and the view input data. Have a look at the “Select.ByCategorieAndView” Node:


Edit: Oh, just saw that your rooms are in a linked model, don’t know if it will work with the linked elements.

Since my last post is invalid because of the linked elements, I tried another way.

Maybe this could help you:

As you see, I’ve 401 rooms in my linked model. But through the “Select.ByCategorieAndView” Node from the GeniusLoci Package you can filter just the one visible room in the selected view, by connecting the RevitLinkInstance.

Gerrit, thanks for taking the time to look into this. I’m going to give that a go now I’ll let you know how it goes!

I don’t think ‘SelectByCategoryAndView’ helps in this case since it only works with a single view. I need to apply the room tags to a list of views.

In my case it’s actually working with lists.

Maybe you have to take a look on the list levels. If you’ve more levels you have to switch the nodes level:

1 Like

OK thanks for the pointers, I’ll take a closer look over the weekend and let you know how I get on.

Did you select views from your active model and rooms from a linked model?

My output from this node is a null, even if I only select 1 view.

Yes, rooms of the linked model and views from the active model.
If you upload your dyn-file, i could take a look and may help you better.

Room Tags.dyn (53.9 KB)
Room Tags 2.dyn (19.8 KB)

Sure, I’ve uploaded the first script I created and the revised one where I tried ‘by category and view’.

I’m using:
Revit 2018
Dynamo 2.02 2018.13.13
Clockwork for Dynamo 2.x 2.1.2
Genius Loci 2018.12.18

There’s a bug in the version of Dynamo I’m using where a script using both Archilab and Steamnodes causes a crash during open for some scripts, but if you first open a script that’s using only Archilab then open this one it will work.


I tried your “Room Tags 2.dyn” and it’s working perfectly fine on my machine.

But the difference is that I’m on R19 and Dynamo 2.0.3. and I also got the newest version of the GeniusLoci Package (2019.9.26).
So maybe you could check if the newest version of the GeniusLoci Package will already do the job.

Otherwise I have no idea if it could also be the R18 or Dyn 2.0.2…

OK, I’ll test both on Revit 2018 to see if I can get it working. Cheers.

I’ve tried running it on R19, Dynamo 2.0.3 and Genius Loci 2019.9.26 and I still only get Nulls.

The rooms are being picked up from the linked document and the rooms are visible in the view I selected. No matter what I try I only ever get nulls.

Ok. During my testing I only got documents with the same template. So both documents got the same views. Now I tried to delete the view in the linked model and also got the “null”, meaning that the SelectByCategoryAndView will probably search for the view in the linked model, not the active one.
If your linked model doesn’t contain the view, you get the nulls. Could that be the problem?

Yep that could be it. This won’t work for me because I am trying to add room tags to most of the floor plan views in the MEP model (254 views in total) but only adding tags that are visible in view.

The second script I posted seemed to work, but the fact that it placed 100,000 tags means it’s not the solution :slight_smile:

I don’t have any more time to spend on developing this script for now, but thanks for your help I appreciate it.

Allright, you’re welcome! If you come back to this at any point, you can consider to use the views level instead of the view as an input. If you got the same levels in the different models, it will work and not depend on the existence of the view in all models. :slightly_smiling_face:

I was on a similar path, I setup a filter using the first digit from the room number parameter to filter by level, but your method is better since it reduces the chance of human error so I’ll incorporate that.

I just need to create multiple node chains to plot the room points at each level then apply them to the views for those levels, progress!!

My wife isn’t too pleased as I’ve now taken over the TV in the living room and it’s a holiday weekend, the Dynamo bug has a grip of me!

It’s working :slight_smile:

I multiplied the rooms by the number of views and everything is now matching. All I need to do now is duplicate the level nodes to apply to the other floors.

Your input really helped along the way, it was a lot of trial and error but success is a good feeling. All the best…

Room Tags By Level.dyn (73.3 KB)

1 Like

Nice! Good to hear that it’s working! :slight_smile: Since the Dynamo bug also got a grip on me, I was happy to help. :wink:

@Rob.Fern, @Gerrit_M,

Gentlemen, thanks for this thread. It helped me finally get a graph to the point that it is working. I’ve attached a copy, if you’re interested - you will see a lot of the work you so kindly shared in it.

My concern is that this works well only if I have a relatively small number of floors - in this example there are 6. And, it has an ugly but where I run it once with the tag placing turned off to generate a list of the names of the levels, and then manually plug them into the next piece of the graph before running it again. And I have to watch for the level name not appearing in the view name - in this case, we have a “ROOF” plan where the level is named “T.O. Deck”

I’m about to start trying to make the revisions needed to have this work regardless of the number of levels involved. I’ll post back if I succeed -

Place Room Tags v3.dyn (253.5 KB)