Objects Full Layer Name



how can i get the full layername of an object with rhinoscriptsyntax?
rs.ObjectLayer(object) returns the layer name without parent layers.
rs.ParentLayer(layer) returns the full path , but this doesnt work if i have several childlayers with the same name.
Thanks in advance!



Yes, apparently this functionality is not yet available in Python rhinoscriptsyntax, only vb… Let me see if I can figure it out with RhinoCommon…



Something like this should do it (don’t know if there is an easier way…)

import rhinoscriptsyntax as rs
import scriptcontext as sc

layer_index = sc.doc.Layers.Find(layer, True)
full_name = sc.doc.Layers[layer_index].FullPath

Edit: nope, doesn’t work if there are multiple sublayers with the same name, it just finds the first in the list… :frowning:


Python rs.ObjectLayer() - option to return full layer path

OK, this is much better, sorry for the mispost… --Mitch

import rhinoscriptsyntax as rs
import scriptcontext as sc

print full_name


Thanks a lot Mitch!

(Steve Baer) #6

I just added LayerIds and LayerName for SR7. If you want these functions before SR7, you can get the file at

I don’t see why you would need to get the file though since Mitch already wrote a great workaround.