algorithmic modeling for Rhino
Since this should have been a new discussion right from start, I gather the previuos.
What has been discussed so far:
Hi,
can someone please tell me how to mod Giulio´s latest bakeAttribute, so it also sets a specified layercolor?
Thanks,
Phillip
Hi Phillip
if possible, you should try to modify layer colors independently from baking. A layer can have only one color, but many objects.
To modify a layer color, use something along these lines:
if(!string.IsNullOrEmpty(layer) && !color.IsEmpty)
{
int n = RhinoDoc.ActiveDoc.Layers.Find(layer, true);
if(n < 0) return;
Rhino.DocObjects.Layer l = RhinoDoc.ActiveDoc.Layers[n];
l.Color = color;
A = l.CommitChanges();
}
Can I also ask you to start a new discussion next time?
I hope this helps,
- Giulio
Tags:
Thanks Phillip for posting everything about this discussion. By now it was happening a little bit everywhere :)
This line changes the color of the layer before it was added to the document:
onlayer.Color = color;
And these update the color of the layer:
Rhino.DocObjects.Layer onlayer = layerTable[layerIndex];
onlayer.Color = color;
onlayer.CommitChanges();
Together, this becomes the attached file.
I hope this follows the specs,
- Giulio
_________________
giulio@mcneel.com
Hi Giulio,
Great!
Just as my guess - the right word in the right place.
Impossible for me though to figure it out myself, especially the second part.
I really need to get more into this.
Thanks a lot! (And thanks for the dedicated filename, hehe.)
Best,
Phillip
Hi Giulio,
Just wanted to say Thank you for the latest bakeAttribute tool, it has been very very helpful.
Your a legend
Chris
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by