Controlling draw order with grasshopper

Quick question, is there any plugin to control draw order of rhino layers using grasshopper,

ie, can i command rhino to ‘BringToFront’ any layers or objects i specify

I.e, i am using Human to control plot weights and print color, would like to be able to control draw order also

thanks

I’ve wrote a little code that can help you achieve what you’re looking for:
Arkadius%20Belov

if(!run)
  return;
for(int i = 0; i < layers.Count; i++)
{
  Rhino.DocObjects.RhinoObject[] rhobjs = doc.Objects.FindByLayer(layers[i]);
  foreach(Rhino.DocObjects.RhinoObject rhobj in rhobjs)
  {
    rhobj.Attributes.DisplayOrder = i;
    rhobj.CommitChanges();
  }
}

Arkadius Belov.3dm (56.3 KB)
Arkadius Belov.gh (15.7 KB)

2 Likes

Thank you very much Mahdiyar,
the definition works as given,
and your presentation of it was very easy to understand

arkadius