Create Custom Legend for Constructions

Hi all, I aim to cycle through different program zones by using the HB Colour Face Attributes component, while my legend stays constant and continues to show all construction in the model. This is because I find it irritating that the mesh changes colour when referring to the same constructions as I cycle through zones in the model.

I have tried using the LB Create Legend and the LB Legend Parameters Categorized component, but I have not quite found success. Has anyone tried anything like this yet, or perhaps have a better solution?

Please see my simplified GH file.
Create Custom Legend.gh (92.5 KB)

Yes, this is a bit beyond what the HB Colour Face Attributes was designed to do. But there’s always a way to do what you want in a scripting interface like grasshopper.

Here’s how you can get the colors associated with constructions to be constant across a model:


Create Custom Legend.gh (93.6 KB)

1 Like

Thanks Chris, I can see that this is much better strategy!
Though looking at the visual output, it was not quite correct, as the construction colour were getting swapped around. This was more apparent when multiple zones per program were passed into the script. I have corrected the script in the attached file and you can see the outcome of the correction in the attached image, with before output in the top image and the corrected script in the below image.
Thanks for your help figuring this out!


Create Custom Legend_MS.gh (96.7 KB)

1 Like