I never heard about GroupByKey, I guess it somewhat the same principle as a Python Dictionary?
For now I seem to have solved my problem, but I still have the feeling I made it unnecessary complicated.
Here is what I did, I made sure I only assigned a color to unique types.
Then I used a Python script to check if the elements are equal to that type;
After some tweaking I could write them to the Element.OverridesColorsInView Node,
It doesn’t seem to work properly for Structural Framing in Structural Beam Systems
Here is what it looks like before I run the script;
And here is after (Remember, the aim was to assign a unique color to each element of a type of structural framing);
As you can see the Structural Framing in the Structural Beam Systems only assigned a color to one beam. I will do some more testing.
edit: I ran my script several times and what I came across is the following;
- colors are not uniqe to the types, because I generate random colors and assign them to the type it can occur that the same color is being used twice
- I have no idea why some beams won’t change their color, it seems completely random. I added and removed some beams. Used structural framing or beam system, but I can’t seem to find a pattern.
I will revise my script entirely.