Coloring phase in 3D view

Hi,

I created a simple dynamo for coloring the phase in the active view.
In the code below I have two solutions to make this.
The first one which is the more simple although I don’t undersant why it doesn’t work. In the == node all the results are false. There is I think a type data incompatibility.
In the second solution I introduced the Element.Id that I compare and it works.

Do you have an idea why the first solution doesn’t work ?

Yes, It seems like problem as you said is data type incompability. Try to add 2 String from object nodes before == node.

I tried with the String from Object but it returns only the text “Phase”
After to display the text and compate it seems more difficult. So maybe the Element.Id solution is the more simple.

I’m sharing the dynamo. I think this script is usefull because Revit don’t let us simply color the phases of our project.

Test_Phase_coloring_2.0.dyn (21.9 KB)

1 Like

Ah, understood. Workflow with IDs is the most reliable for sure.

But I guess you can also try Element.Name (or Element Name+ from Clockwork) nodes instead of String from object. Just If you want to compare strings instead of IDs

Yes you’re right about Element.Name ! It’s working also with the same number of nodes than the Element.Id method.

Thanks for the tips.

1 Like