Unique ID for Layers?

Hello,
Is there a way to access a unique ID for a layer with Python?

Thanks

Yep -

e.g.

import scriptcontext as sc

L = sc.doc.Layers.FindName("Layer 01")
id = L.Id

-Pascal

Hello Pascal,
Thanks for your response.

This one throws an error for me.

I researched more and ended up using this:

#coding=utf-8
import rhinoscriptsyntax as rs
import scriptcontext as sc

LayerNames = rs.LayerNames()
    
for Layer in LayerNames:
    
    #   get unique Layer ID
    LayerID = rs.LayerId(Layer)
    print LayerID