Home/ Reference/ Geometry & Transform

shape.GetBoundingBox()

Returns (x, y, w, h). The only way to read the position of text inside a container — objects in a PowerClip have no Left/Top.

Signature

shape.GetBoundingBox()

Notes

Returns (x, y, w, h). The only way to read the position of text inside a container — objects in a PowerClip have no Left/Top.

Python example (runnable)

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

# GetBoundingBox() returns (x, y, width, height)
# shapes inside a PowerClip have no Left/Top; this is the only way in
x, y, w, h = shape.GetBoundingBox()

print("Top-left x: ", x)
print("Bottom-left y: ", y)
print("Size: ", w, h)
print("Area: ", round(w * h, 4))

About this section: Geometry & Transform

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

Other entries in this section