Even the simplest of tasks can be automated. When starting from scratch in an empty Rhino file, quite some clicks with the mouse can be involved in creating the necessary layers to keep an ordered model. A few lines of code in A Python script inside Rhino let you do this from the command line. Nothing complex, just utilising the rhinosctipsyntax to access the functions in Rhino inside Python.
The below example shows how to create a two-level layer structure. It works like this: run the Python script in Rhino, Type the name of the layer followed by “space” or “enter”. The layer is created. Now, you’re prompted to create a sublayer name or type “space” again for another layer. This can be done for as many layers as necessary. All from the command line. It can easily be extended to include layer of colours, lock layer and so forth.
Note the two function calls “rs.GetString()” which takes the user input from the command line in Rhino, and “rs.AddLayer()” which creates the layer in Rhino. All you have to in order to get started is to run the command “_EditPythonScript” in the Rhino command line and paste the below code in the editor!

Create layers from command line.

Layers created from command line
Feel free to try it out with the code to the Python script:
import rhinoscriptsyntax as rs
"""
<https://developer.rhino3d.com/api/RhinoScriptSyntax/#layer-AddLayer>
<https://discourse.mcneel.com/t/running-python-scripts-from-aliases-or-toolbar-buttons/47290>
Remember how to add it as a shortcut.
"""
def create_layer(name, color=None, visible=True, locked=False, parent=None):
"""Check if a layer already exists and create it if not."""
if rs.IsLayer(name):
print("Layer '{name}' already exists.".format(name))
else:
#rs.AddLayer(name, parent=parent, color=color, visible=visible, locked=locked)
rs.AddLayer(name, parent = parent, color = color, visible = visible, locked = locked)
if __name__ == '__main__':
while True:
layer_str = rs.GetString("Enter Parent Layer Name (Press Enter/Space to Stop)", strings=["Grid", "Columns", "Beams"])
if layer_str == "":
break
create_layer(layer_str) # Create first layer
while True:
child_str = rs.GetString("Enter Sub-Layer Name (Press Enter/Space to Break)")
if child_str == "":
break
# Create the child layer with the parent name passed as an argument
create_layer(child_str, parent=layer_str)