Home/ Reference/ Pattern / Texture Fill

shape.Fill.CopyAssign(source_fill)

Copies one shape's fill onto another — the fill half of the format painter. Outlines need their own copy through Outline.

Signature

shape.Fill.CopyAssign(source_fill)

Notes

Copies one shape's fill onto another — the fill half of the format painter. Outlines need their own copy through Outline.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
shapes = app.ActiveSelectionRange                   # select two or more; the first is the template
src = shapes.Item(1).Fill                           # copy the first fill

for i in range(2, shapes.Count + 1):
    shapes.Item(i).Fill.CopyAssign(src)             # paint them all the same

print("Copied the first fill onto the rest", shapes.Count - 1, " item(s)")

About this section: Pattern / Texture Fill

Pattern / Texture Fill — pattern, texture and PostScript fills.

Other entries in this section