Create Annotation Tag with multiple TagTypes

Hello,

I’m trying to automate electrical riser diagrams so the first step was creating different Annotation Family Types to represent all of the different electrical equipment. Now I’m using dynamo to create these annotation tags but the Create Annotation Tag is unable to accept a list of Family Types. It’s basically tagging all of my electrical equipment with the same Family Type, but I would like to be able to send it a list of family types. Is there a way to use the nodes to be able to possibly cycle through a family types list and tag it correctly? P.S. I realize the null values are causing an error for the point location.

Are you trying to tag the same element with multiple tags or are you just hoping that only valid tags will work and invalid tags will be “skipped”?

If you’re trying to tag elements with multiple tags you’ll need to use List.Map or cycle the elements and locations to force Dynamo to run through each element twice.

1 Like

I’m trying to tag an element with a specific Family Type tag. Say the first element “NPL-01” is existing. Well he needs the existing panel type tag I’ve made, while the second element(lets pretend its a main switch board) “ELP-11” needs a main switch board type tag. There should never be any invalid tags and nothing should be skipped. I’m not trying to tag elements with multiple tags but instead tag an element once with its specific tag. Sorry for not explaining myself very well.

You’ll have to sort your elements by tag type (whether that’s by phase, category, family, etc.) before you can apply tags then. Try getting all your elements sorted or filtered as a first step.

2 Likes

I’m a little confused. Do I not already have my elements filtered? I’ve filtered down to the 27 panels I need tagged and later I’m going to make a python script to determine what type goes with what panel. Before I make the python script to do that though I need to make sure that this hypothetical list can be applied to the TagType or have a way to cycle through that list to Create 27 independent Tags.

Edit: Oh I think I know what you’re proposing. You’re saying that I need to filter the 27 elements by TagType and then send that list of filtered elements to the Create Annotation Tag. After, cycle to the next group to be tagged along with the different family type?

Edit2: Honestly, I think that will get pretty messy so I might try and copy the source code from the Create Annotation Tag and try to alter it to allow either one TagType or an array… Then again if I were to deviate from the node and @Konrad_K_Sobon were to update his library I would no longer be synced. :confused:

Yes it’s possible.

The easiest(?) way might even be to break your list of elements into multiple lists, but it might not be necessary.
Essentially you want your list structure to match between elements and tags like this:

ElementType1 —> Tag1
ElementType2 —> Tag2
ElementType2 —> Tag2
ElementType3 —> Tag3
ElementType1 —> Tag1
ElementType3 —> Tag3

or like this:

List1
ElementType1 —> Tag1
ElementType1 —> Tag1
List2
ElementType2 —> Tag2
ElementType2 —> Tag2
List3
ElementType3 —> Tag3
ElementType3 —> Tag3

The important part is that every element have a tag. How you sort/filter is up to you.

The problem is not multiple tag types. It’s your list structure. Try working on the next piece of your script. Once your elements are sorted it will be easier to manipulate the tag types.

1 Like

I don’t understand how I’m supposed to feed it multiple tag types though… Ok so if my list structure for the TagType matches both the TagLocations and Elements shouldn’t this work, but give it all the same Family Type? How would the cycle play into this to be able to vary the multiple tag types along with the List1, List2, List3 that you’re suggesting?

It should work as you have it now. (Not with the correct tag types, but it should at least create a tag). Assuming all those elements are visible in that view and can take the tag type you supplied it should be creating tags for those elements. Try working with just the first element and see if it works - it’s hard to tell what’s causing issues.

2 Likes

I just don’t think that is the issue. I’m pretty sure the TagType can not be an array and it has to be a single Family Type. Also I tried it with one element and I received a null output again. As for the elements they are visible because I was able to tag them originally when I had one Family Type. I’ve attached the dynamo file, but I’m unable to attach the Revit file due to company policy.

tagging panels.dyn (14.3 KB)

If that doesn’t work check to see if the location is correct. May have a 2D vs 3D conversion issue.

It works as an array but you have to use List.Map as I mentioned in my first post.


But you said you’re not wanting every element tagged with every tag type. If you want to tag each element with a specific tag type you’ll have to sort your elements by tag type then tag each list based on that tag type.

1 Like

Hello,i’ve run in a similar problem and cannot find the solution by myself.I’m trying to tag all rebars of a slab,but here’s what happens.

The number of Rebars,Locations and Elements is the same.I use Dynamo 2.0

Hello again,
I’ve found the solution for my problem.See this thread
https://forum.dynamobim.com/t/tag-textnote-multi-category-elements/9592/20

Now i have another problem.The node is creating the tag,but i cannot see them in revit?

Hi @Nick_Boyts,

perhaps you can help me with this one

I want to use create annotation tag, but I get AttributeError: Document object has no attribute ‘NewTag’.
image

  • I already tried dyn 1.3 and 2.0
  • different tag types
    different location (it should be a point, right?)
    specific view instead of active view

Hi Merlijn,

The Tag creation changed in the Revit 2019 API.
You can use the Create Independant Tag node in Genius Loci package instead.
This is an update of the Create annotation Tag node.
Thanks to Konrad Sobon for making the original one.

Thanks @Alban_de_Chasteigner, that did the trick !:slight_smile:
Now I’m trying to do it with list.map like @Nick_Boyts did in his example. But I get expected element, got List[object].

Do you perhaps know what I’m doing wrong here? I already tried using levels for element, but both isn’t working

The “List Level” feature has replaced most uses of the List.Map node.
You can try with the List Level @L1 on the TagType Input of the Create Independant Tag node.

1 Like

Now I’ve tried also in 2018. Single tag goes perfect, but now I’m trying with the list map, it gives me ‘list[object]’ object has no attribute ‘ToXyz’.

So I guess I’m doing something wrong with list management… :frowning:

I could of course separate the nested links and duplicate the create annotation tag 3 times, but I’d like to understand this function.

thanks in advance!

Maybe with longest lacing on the Create Independant Tag node ?