Home/ Reference/ Layer & Shapes

layer.Name

Layer name, read/write. Batch template jobs look layers up by name.

Signature

layer.Name

Notes

Layer name, read/write. Batch template jobs look layers up by name.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
layer = doc.ActivePage.ActiveLayer

layer.Name = "Content"               # rename the layer so you can find it by name later
print("Layer renamed to: ", layer.Name)

# look a layer up by name
for i in range(1, doc.ActivePage.Layers.Count + 1):
    lay = doc.ActivePage.Layers.Item(i)
    if lay.Name == "Content":
        print("Found on layer ", i, "")

About this section: Layer & Shapes

Layer & Shapes — layers and shape creation.

Other entries in this section