Home/ Reference/ Align / Distribute

shape.SetBoundingBox(X, Y, Width, Height)

Sets position and size in one call — positioning and scaling merged. The least code for batch template work.

Signature

shape.SetBoundingBox(X, Y, Width, Height)

Notes

Sets position and size in one call — positioning and scaling merged. The least code for batch template work.

Python example (runnable)

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

shape.SetBoundingBox(0, 0, 80 / 25.4, 50 / 25.4)    # bottom-left at 0,0, 80mm wide, 50mm tall
print("Size now: ", shape.SizeWidth * 25.4, "x", shape.SizeHeight * 25.4, "mm")

About this section: Align / Distribute

Align / Distribute — align, distribute and transform.

Other entries in this section