When one exports a Rhino document into DWG the whole layer tree is flattened - the parent/sublayer hierarchy is lost. The information can be preserved by using the proper export option so that the layers are named like this:
When importing the DWG back into Rhino6, the parent/child hierarchy is not reconstructed, developers please fix that!
Failed attempt at a workaround:
I replace every
:: by running a script:
import rhinoscriptsyntax as rs from scriptcontext import doc def rename(): currentLayersAll = rs.LayerNames() for currentLayerName in currentLayersAll: #print(currentLayerName) newLayerName = currentLayerName.replace("$","::") #print(newLayerName) rs.RenameLayer(currentLayerName, newLayerName) rename()
All the layers are renamed, but they do not get nested! The double colon becomes part of the layer name.
However when I print() the name of actual nested layer with rs.LayerNames() this is the output:
I am confused, how can I reconstruct the layer hierarchy when Rhino does not bother tot?