Need help completing workflow

I need help completing a workflow. I want to override the color of elements in a Revit model based on the value of a column in a CSV file.

Specifically what I am trying to do is I have a CSV file with a column that lists the construction stage of every element, i.e. in progress, not started or complete. I want the script to read this status for each element, and then override the color of the element, i.e. green for complete etc.

I can get two list, one for element Id, and then a code block with all of the status’s listed, but its the next step in filtering the element before the colour override that has me stumped.

Any help would be very much appreciated.

Edit: screenshot below. There also appears to be a problem with my List.GetItemAtIndex node, though I do not know what!?
Edit 2: I can now upload!!
Edit 3: I’ve uploaded the CSV file as an Excel file, if anyone wants a look!


Ass2_D23126871_Construction_Progress_Part_2.dyn (24.1 KB)
Input_Model_Construction_Progress.rvt (7.4 MB)
Ass2_D23126871_Construction_Progress_Stage_1.xlsx (10.2 KB)

Hi @MLynch best if you share the csv as well, if people should try help…

I tried to share the csv but it would not let me. Perhaps I can set up a link?
Edit: I’ve uploaded it as an excel file instead, as that part of the workflow is not a problem.

use a dictionary to link colors with the status text in the csv

1 Like

yeah you could share with webtransfer, file transfer or try give you file .txt extension

Thanks sovitek. I’ve uploaded the file as a excel file instead, as I can manage that part. Its getting the lists to filter according to the construction status, and then applying the colours that I am struggling with.

timhevel, thank you very much! Could you share that dynamo file please? How do I get the colours to apply to the instances of the elements? Do I need some sort of filter?

Edit: timhevel, just to clarify, how do I do the linking of the colours to the status in the CSV file part?

Hi @MLynch yeah a dictionary is the way…but you have some element there give null becaurse it doesnt have any value in your excel/csv…so try filter them out first…

Ass2_D23126871_Construction_Progress_Part_2.dyn (33.8 KB)

Sovitek and Timhevel, that you both so much! Sovitek I’ve marked yours as the solution, although you both gave the answer I needed!

Thank you both again!

Friendly reminder here… use UniqueId
Screen Shot 2024-11-03 at 7.30.09 am

2 Likes