Home/ Reference/ Geometry & Transform

shape.Type

1 rectangle / 2 ellipse / 3 curve / 5 bitmap / 6 text / 7 group. After converting to curves a text object turns into 3 (or 7 if it was inside a container).

Signature

shape.Type

Notes

1 rectangle / 2 ellipse / 3 curve / 5 bitmap / 6 text / 7 group. After converting to curves a text object turns into 3 (or 7 if it was inside a container).

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
shape = app.ActiveSelectionRange(1)

t = shape.Type
names = {1: "Rectangle", 2: "Ellipse", 3: "Curve", 4: "Polygon",
         5: "Bitmap", 6: "Text", 7: "Group", 8: "Selection"}
print("Type code: ", t, "→", names.get(t, "Other"))

if t == 6:                              # only text shapes expose .Text
    print("Text: ", shape.Text.Contents)

About this section: Geometry & Transform

Geometry & Transform — position, size and rotation of shapes.

Other entries in this section