Home/ Reference/ Layer & Shapes

layer.Shapes

All shapes on this layer.

Signature

layer.Shapes

Notes

All shapes on this layer.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
layer = doc.ActivePage.ActiveLayer
shapes = layer.Shapes              # collection of every shape on this layer

print("Shapes on this layer: ", shapes.Count)

for i in range(1, shapes.Count + 1):
    s = shapes.Item(i)             # s : the i-th shape
    print(i, "type", s.Type, "name", s.Name)

About this section: Layer & Shapes

Layer & Shapes — layers and shape creation.

Other entries in this section