Alphabetizing layers

Having now paid for the Mac version, it’s still quite annoying that layers cannot be ordered alphabetically. It’s very tedious to work on files with numerous layers created at different times.


January 2016, still no layer sort option. Whats the go guys? I’m dealing on a daily basis with .dwg files with 300+ layers and the ability to sort them alphabetically would be IMMENSELY helpful.

1 Like

Hi Conner, there is a thread named ‘Sort Layers by Name’ in Apr15 (not sure how to link to it) where @Alain posted some Python code which orders the layer list alphabetically. It works fine in Windows so probably in Mac too?

The code can be pasted into a button between the brackets,
_-NoEcho _-RunPythonScript (

'Paste here


The code sorts the list descending and if you also want to sort ascending on the right click of the button, you’ll find ‘reverse=True’ in the second paragraph of the code which can be changed to ‘reverse=False’.

Hope it works for you on Mac, sounds like a time-consuming problem…

Sorry, script does not working for me:

_-NoEcho _-RunPythonScript (

import rhinoscriptsyntax as rs
from scriptcontext import doc
from System import Guid

sorted_layer_names = sorted([layer.FullPath for layer in doc.Layers
if layer.ParentLayerId == Guid.Empty],
key=lambda s: s.lower(), reverse=True)

tmp_layer_name = rs.AddLayer(Guid.NewGuid().ToString())
tmp = doc.Layers[doc.Layers.FindByFullPath(tmp_layer_name, False)]

for fp in sorted_layer_names:
l = doc.Layers[doc.Layers.FindByFullPath(fp, False)]
l.ParentLayerId = tmp.Id
l.ParentLayerId = Guid.Empty

doc.Layers.Delete(tmp.LayerIndex, True)

The code is working here, do you have a 4 space indent as shown - that will stop it working…

sorry, no luck :confused:

2 years ago - Will this be fixed in 5.2, please?

Any news, please?

bump - No layer sorting and no batch layers properties change is the pain…

@marlin Any word on this functionality?

@dan @brian, please

I believe you are referring to this issue (MR-456). This is no update on this issue. I would encourage you to login to YouTrack and “watch” (star) this issue. You will get email updates when the issue’s status changes (you can see when someone is working on it, what the problems are, etc).

Sorry this is not yet in Rhino 5 for Mac.


@dan this issue is tracked from early 2011 and still not solved. For people working with CAD files with 30+ layers is Rhino for Mac unusable:
No way to alphabetize layers
No way to change layer color, layer line with, print color, material for selected layers.

eg: changing print color for 60 layers means 60 times set print color!

Quickest solution is to start virtual machine with Rhino for Windows instalelled, open the file, sort layes with ONE CLICK, set layer linetypes, colors with TWO Clicks, save the file and reopen in Rhino in Mac.

And this is reported from 2011! :confused:

@dan @marlin @brian
open this file:
example.dwg (1.4 MB)

  • try to QUICK sort layers
  • try to QUICK set gray as print color for all layers except two (without endlesly searching for layers names in unsorted layer list)
  • try to QUICK change linetype for 20 selected layers (again without endlesly searching for layers names in unsorted layer list)

= Rhino for Mac - compared to Windows version - is completely unusable in this case

You are preaching to the choir. I have made this case multiple times. The layer manager is a very complex control in Rhino for Windows. @dale and I have discussed what it would take to make this control work cross-platform and it is a very large amount of work.

So any ETA, please?

Sorry, no ETA. The release target for that item is Rhino 6.

could you get above script working, please?

Reporting from 2019, too bad the feature hasn’t arrived yet. Would love to have this!

1 Like

We release it’s been a long wait but…

RH-36493 Layer: Sorting is not fully supported

should now be fixed in the latest Rhino 6 for Mac Service Release.

1 Like