Hi,
I was doing some work today in gh, creating a definition that is going to be used mainly by other users. I then found myself, once again, needing to set different color groups based on general rules for clarification purposes.
You see in this image, all sliders have a group, and all geometry to be baked is “on” in preview and has a blob group outline. Still I feel this is not enough, I wish I could automatically assign a different color to these two categories: Sliders and geometry to be baked.
This discussion here is quite old, but David provided a very handy script that changes the color based on the name of the group. But… for cases such as mine its not ideal. I wonder if something like this can be improved upon.
The idea is to be able to assign a different group color to components that:
Have preview set on
Have a blob, box or rectangle outline
Special components such as panels, sliders, containers, etc.
The color component can be embedded in your GH files, perhaps hidden in a Cluster wich can be reused.
If you don’t want the colorizing components in your file, then insert the cluster with the color components, set the colors (for all color-coded groups, see C1, C2, C3 or whatever color group codes of your choice) and when done setting the colors then just delete the components/clusters from the definition.
Hi Rolf, the color VB script and componets is no problem. I am not worried about it being in the file.
I currently use it the way you suggested. But it is quite impractical to name every group when definitions start having many sliders and bmany components need baking, even if the name is a single character like “0”.
Hey Rolf, I am getting some errors with the C# components, maybe because I am not using the latest version?
It says: The first component error states: “The type or namespace ‘GH_Group’ could not be found… (Line 94)”
Hm. Strange. I couldn’t drill down to find out in which namespace the GH_Group type resides in. These are the namespaces that I had in the component (I added “Drawing” and “Special”)
Perhaps @DavidRutten knows why some namespaces are missing. I know that not all .dll’s are even reachable from the Script Components, depending on GH version they have to be explicitly assigned to the component. My Grasshopper version seems to be 1.0.0007
How could your C# change only the colour of the group that belongs to, without using a group name?. I’d like to implement this inside my code, thank you in advance!