Home/ Reference/ Find & Traverse

coll.FindShapes("", 7, True)

Every group. When a document is huge, searching only the current level for groups skips the mass of leaf nodes — that's the idea behind a performance guard.

Signature

coll.FindShapes("", 7, True)

Notes

Every group. When a document is huge, searching only the current level for groups skips the mass of leaf nodes — that's the idea behind a performance guard.

Python example (runnable)

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

groups = page.FindShapes("", 7, True)          # 7 = group
print("Groups: ", groups.Count)

# performance guard: on huge documents, query groups only to skip the leaves
for i in range(1, groups.Count + 1):
    g = groups.Item(i)
    print("Group", i, "members", g.Shapes.Count)

About this section: Find & Traverse

Find & Traverse — walking the shape tree.

Other entries in this section