Home/ Reference/ Geometry & Transform

shape.SizeWidth / .SizeHeight

Width and height, read/write. When scaling, read the current size first, then compute the new one as a ratio.

Signature

shape.SizeWidth / .SizeHeight

Notes

Width and height, read/write. When scaling, read the current size first, then compute the new one as a ratio.

Python example (runnable)

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

w, h = shape.SizeWidth, shape.SizeHeight    # read the original size
print("Original size: ", w, "x", h)

shape.SizeWidth  = 100 / 25.4               # change width only (this stretches, it does not keep the ratio)
shape.SizeHeight = 60 / 25.4

print("New size: ", shape.SizeWidth, "x", shape.SizeHeight)

About this section: Geometry & Transform

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

Other entries in this section