Home/ Reference/ Layer & Shapes

layer.FindShapes(query, type, recursive)

Layer-level search. The three calls worth memorizing: ("", 6, True) text, ("", 7, True) groups, ("", 5, True) bitmaps.

Signature

layer.FindShapes(query, type, recursive)

Notes

Layer-level search. The three calls worth memorizing: ("", 6, True) text, ("", 7, True) groups, ("", 5, True) bitmaps.

Python example (runnable)

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

texts = layer.FindShapes("", 6, True)      # 6=text, True=look inside groups too
print("Text shapes: ", texts.Count)

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

bitmaps = layer.FindShapes("", 5, True)    # 5=bitmap
print("Bitmaps: ", bitmaps.Count)

About this section: Layer & Shapes

Layer & Shapes — layers and shape creation.

Other entries in this section