Code Block Color Node Issues

I’m trying to use a couple code blocks to create a dictionary for color names and RBG values. I then read color strings from an excel file and get the value at the key.

Before doing this I had a node that just set the color to black for every line style. When I did this I was able to create all the line styles I needed and place them on a view.

Now that I’ve tried doing this I’ve only been able to create 4 styles and place 4 lines. All of them are black and I’ve also noticed they have the incorrect patterns assigned to them.

The warning on the LinePatternElement.GetByName node is because the name “Solid” doesn’t work, it returns null which makes Revit choose Solid line pattern for anyway.

This is the spreadsheet I’m using:

Revit Dev - Line Pattern Script V2.dyn (344.3 KB)

I got it figured out. I had an issue with list level. It works now. I also cleaned up the code block because it was originally from “node to code” so it had an extra variable it didn’t need. Finally feeling like I’m getting comfortable in code blocks.