Setting display order with Layers in Rhino.NET sdk

I see in the sdksamples for Rhino.NET SDK how to create a new layer with a given layer_index and name.

I want to use Layer order, programmatically, from the SDK, to dictate display order.

Is there an example(s) or place to look in the SDK documentation, where I can learn how change the layer order programmatically. I’m assuming “layer order” means the same as what is shown in the GUI’s Layer window with its up and down arrow icons for changing order – and that earlier layers are displayed closer to front. (Perhaps I’m wrong in that assumption.)

(At one time there was a way in the C++ SDK to dictate display order per object. I’m assuming that’s not available to C# in Rhino.NET SDK, and that the way to programmatically bring things to front or forward or back is by layers – am I correct?)

I guess what I’m looking for in general is a pointer to documentation that shows how to programmatically specify display order.

Thank you,

Peter Schwenn

Rhino 5 has BringForward, SendBackward, BringToFront, MoveToBack, and ClearDrawOrder commands to set draw order on objects.

Layer order is only used for display order in our “windows” display mode (not OpenGL). The only place you typically see this is when printing to vector output.

I take it BringForward, SendBackward, … ClearDrawOrder are commands only and are not available programmatically from the Rhino.NET SDK? If that’s true is there ANY programmatic way to make one of two or more objects that share the same geometric space, display “on top”?

http://mcneel.myjetbrains.com/youtrack/issue/RH-25544

This will be available in SR10. There will be a new DisplayOrder property on ObjectAttributes that you can use. Sorry for the incredibly long delay in getting this implemented.

another resurection…

@stevebaer how do we get access to this info?

I’m not sure what you are asking for.

There will be a new DisplayOrder property on ObjectAttributes

looking for a better way to manage display order than running the commands over and over hoping to get the result desired.

almost like if you could pick an object and say move this above that.

Is this a programming question? You should be able to script display order with python or C#

ahhh, ok, i didn’t realize that you meant it was exposed in scripting.

i guess i’ll try with my limited abilities to conjure something up. :wink:

thank you.

are there any examples?

EDIT: @stevebaer what is the function to look for in the Rhino Docs? not finding ObjectAttributes function. thanks

Hi Ryan,

Objects in the ObjectTable have Attributes these Attributes have a Property DisplayOrder. I suppose that will set the DisplayOrder:

http://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_DocObjects_ObjectAttributes.htm

http://developer.rhino3d.com/api/RhinoCommon/html/P_Rhino_DocObjects_ObjectAttributes_DisplayOrder.htm

HTH
-Willem

1 Like