Home/ Reference/ Find & Traverse

shape.PowerClip → .Shapes

Container descent. Containers can sit inside containers, so push those onto the stack too.

Signature

shape.PowerClip → .Shapes

Notes

Container descent. Containers can sit inside containers, so push those onto the stack too.

Python example (runnable)

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

# frames can hold groups and text too, so walk into them as well
for i in range(1, page.Shapes.Count + 1):
    s = page.Shapes.Item(i)

    try:
        pc = s.PowerClip
    except Exception:
        pc = None

    if pc is None:
        continue

    inner = pc.Shapes
    print("container", i, " objects inside: ", inner.Count)

    for k in range(1, inner.Count + 1):
        item = inner.Item(k)
        print("   ", k, "type", item.Type)

About this section: Find & Traverse

Find & Traverse — walking the shape tree.

Other entries in this section