How to identify orphaned tags?


#1

Dear Fellow Dynamaniacs,

Here is what I would like to accomplish: Create a list of all views in the project that have orphaned tags in them (tags that lose their association to an element and display “?” instead of the intended value) so that we can go through and fix them. I’ve started with material tags. Below is the beginning of my effort. I have found other topics on this, like this one http://dynamobim.org/forums/topic/host-of-tag/. However, I have no knowledge of Python so it doesn’t mean much to me. I’m getting empty lists in the Tag.TagText node instead of a list of strings. Any help is appreciated!


#2

This will give you inconsistent results with material tags as the Tag.TagText node appears to read values from the element not the material of the element which the tag points.

A possible workaround would be to look into using the “is orphaned” property which can be read about here:

http://www.revitapidocs.com/2017/4906fa9c-e424-92e7-0b7e-15389726ca78.htm

Alternatively you could do a deeper dive into pulling material tag values correctly by referencing the tag value using the method given here:

http://www.revitapidocs.com/2017/8e297dee-920d-f620-6198-0bed494e3f04.htm

Either way these are deeper dives which will entail some coding.


#3

Thanks for the help @JacobSmall! I will have to dig deeper.


#4

@rlosh you may want to watch this conversation as well:


#5

Just in case you haven’t found an answer… Use the “Try Get Property Value” node from Wombat to filter unorphaned elements.

Good luck!


#6

Hi @ChrisRob,

This is a great tip, unfortunately it only works with Rooms and Spaces, as the issue which @JacobSmall mentions still appears to be current…

Ie. every other kind of tag which is referencing a linked file will not be returned in the ‘all elements of category’.

Thanks again.

Mark


#7

Thanks for the suggestion @ChrisRob Unfortunately, even when the tag displays a question mark, IsOrphaned is still set to “false”. I used Revit Lookup to confirm this. (See snippet below.)


#8

@rlosh yes, you are correct that the IsOrphaned property is showing false. I think this is specific to only elements from a linked model so that when you tag something from a link, and that element in a link was deleted it would change this property to true. This is speculation at this point as I have not tested this.

Anyways, here’s a potential approach:

Instead of testing the isOrphaned property of the tag, we can instead test its contents. if the contents are just a “?” or multiple “???” (this is possible if tag has bindings to multiple parameters. tag text will have x-number of “?” for each parameter that it could not retrieve).

This is contents of the python node that gets the is orphaned property:

This is contents of the python node that gets the tag text property:

Good luck!

Ps. I was using Dynamo 2.0 for this, and as it happens i am on a little outdated version of the Revit, that still doesn’t allow me to copy/paste. Sorry but I could not get the code pasted.


#9

@Konrad_K_Sobon Thanks for the reply. Also, (as shown on the screenshot) the TagText property is empty. Will it still evaluate correctly? Thanks again!


#10

Well the solution that I have posted would not work for TagText property being empty. You would have to add another check. Something along the lines of: if tag text is ??? or “” then consider this tag orphaned.

Please post a sample file (minimal sample if possible) so that I can re-create. Revit 2018 is preferred.


#11

@Konrad_K_Sobon Please see attached file. Orphan Rescue.dyn (15.4 KB) For some reason I can’t get the RVT to upload. I just used the OOTB Architectural template, put in a basic exterior wall, and tagged the wall materials in a section view using the OOTB material tag.

Thanks!


#12

I will need a Revit file. Please post a link to GDrive, Dropbox, Box etc. That’s the easiest way to share. I will need an example of a Revit file that has these orphaned tags. I don’t have any sample models that I can replicate this with.