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?