TAG exchange according to the chosen parameter

Hello, I’m new to designing routines in Dynamo, sorry if the question is too basic. I’m working on a routine in Dynamo for Revit, with the goal of changing the TAG of elements of the ‘Electrical Fixtures’ type based on the value of a text parameter called ‘Sequential’.

Objective: When the value of the ‘Sequential’ parameter is equal to, for example, “02”, I want the TAG to change color, for example from Blue to Red. Otherwise, the TAG should not undergo any change, that is, the color should only change to red when the parameter is “02”. The two TAGs are from different families.

What I’m doing:
1 - Element.GetParameterValueByName: I use this node to access the value of the ‘Sequential’ parameter of each ‘Electrical Fixture’ element.
2 - “==”: I use this node to compare the value of the ‘Sequential’ parameter with the string “02”.
3 - IF: I use the IF node to check the condition. In the True part of the condition, I am using the FamilyTypes node to select the type of TAG that should be applied (Red).
4 - Element.SetType: After determining the type of the TAG in the True part of the IF, I use Element.SetType to apply the red TAG to the elements of the type ‘Electrical Fixtures’ that meet the condition of the parameter being equal to “02”.

Problem: The logic is not working as expected. The TAGs are not changing color correctly. The IF node is not giving the correct output when I compare the value of the ‘Sequential’ parameter with “02”. Even though the condition seems to be set up correctly, the IF node is not returning the expected result and, therefore, the TAGs are not changing to red when the parameter is “02”.

Has anyone faced a similar problem or have any suggestions on how to adjust the logic to ensure that the TAG only changes to red when the parameter is “02”, without changes occurring in other cases?

Hi @henrique.lp im not sure why you use if as you already have true/false in filter bool mask…

1 Like

just like @sovitek said, you don’t need the List.FilterByBoolMask

2 Likes

ÿeah or probably something here…if i understand :wink:

Revit_23wcDqxQWs

1 Like

Hello, thank you very much for helping me, I wish you all the best. I have tried several times without the List.FilterByBoolMask node, but it did not work. My problem is in the output of the “IF” node, as shown in the image, the desired answer is not coming out in the result.

the ‘’’False’’’ also need an input, try to put “” on a code block and connect it to that

1 Like

You believe that the problem was just that! Thank you very much for helping friend!!

1 Like

Hello, I think I’ve counted victory too early. When I’m applying the routine to projects with many elements, it’s not behaving as it should, the TAG changes occur without any pattern. I believe that to solve this I needed to apply the logic to groups or sublists of elements in Dynamo, to avoid overloading the execution of a routine when the number of elements is very large. To change the TAG in small groups of, for example, 10 electrical fixtures, I’m trying to use the List.Chop and List.Map nodes, but I don’t know how to apply them to my routine. Could you help me?

I suggest post another topic showing what’s the bottle neck. If i had to guess your new problem needs a different set of logic of filtering out

1 Like