Alphabetizing layers


#21

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.


#22

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.


#23

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…


#24

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.CommitChanges()
l.ParentLayerId = Guid.Empty
l.CommitChanges()

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


#25

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


#26

sorry, no luck :confused:


#27

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


#28

Any news, please?


#29

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


#30

@marlin Any word on this functionality?


#31

@dan @brian, please


(Dan Belcher) #32

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


#33

@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:


#34

@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


(Dan Belcher) #35

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.


#36

So any ETA, please?


(Dan Belcher) #37

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


#38

could you get above script working, please?