Make layer dialog active using script

I’ve recently found a way to sort layers using RhinoScript but the method only works if the layer dialog is active when the script is run. Is there a way to make the layer dialog active using script?

Hi Aron,

How about running a command macro:
-Layer Visible=No Visible=Yes _Enter


Curious. When you say sort layers what do you mean? Does this inspiration in thinking lead to some kind of popup menu to move objects to layers? (A UI workflow improvement)

Interestingly all it took was Rhino.Command("_Layer"). Thanks!

When I say sort I mean allow the user or script to determine where in the layer dialog they want a new layer to be placed. I had created a separate topic for it and how I got it to work is to create the new layer as a child of the layer you want it under, then unparent it.