Dynamo script to change color of all tags in a project

dynamo
python
#1

Hi,

I’m looking for a way with dynamo to change the color of all the tags, specifically the text in the tags. is this possible?

Any thoughts or feed back is greatly appreciated.

Kind regards,

#2

Probably you can just edit the tag itself without even using dynamo? Why to complicate simple tasks?

#3

How would you change the color of the tag without using Dynamo? Are you setting a family parameter for the color? Are you using element graphic override? You need to figure out how you would do it without using Dynamo first and then translate that into Dynamo.

#4

Thanks @mironov.boris, I could do it manually, the issue is that there are many tag families that need to change and across multiple projects. If I can find a way to do it with a dynamo script it would save me a lot of time.

#5

Thanks @kennyb6, my plan was to edit the label in the tag family which has a ‘Color’ parameter. I understand that this means opening the family document, editing that parameter, reloading the family then close the family document. I found another thread that comes close to want i want (instead of the color they change the font) but i can’t seem to make it work.
here’s the link:

However if anyone has a better way I would really appreciate any input.

#6

You can set the parameter for the label as a parameter in the tag, that way you don’t need to open the family to change it, but can change in the actual project. From there, you can edit it like any other parameter in Dynamo.

#7

Thanks @kennyb6, but i would have to open every family to add the parameter which would be more work than changing the existing label parameter.

I’m looking for a way to do this without manually opening every tag family.

#8

So it sounds like there are two ways of doing this without using graphic overrides.

  1. to open the family to change the parameter on an element inside the family, then load it back in, which is API work using FamilyManager.

  2. open the family, associate the label’s color parameter onto a new family parameter and then change it from outside the family document.

Both are possible to be automated but both will require working with the family API. If you plan on changing the color often or using multiple colors for different things, I would suggest option 2 though it may look like a little bit more work. Here is it in more detail:

First you have to open the family, create a new parameter of type color, then use the AssociateElementParameterToFamilyParameter method. Once that is done, load the family back into Revit and then start on the next one.

It should be able to be automated to do all of the tag families from the project, it will just require a script to do it. Check with packages like Orchid first and see if they have anything like that.