Home/ Reference/ Page

page.ActiveLayer

The active layer of this page. Every Create* method lives on a Layer, so get the layer before you try to make a shape.

Signature

page.ActiveLayer

Notes

The active layer of this page. Every Create* method lives on a Layer, so get the layer before you try to make a shape.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
page = doc.ActivePage
layer = page.ActiveLayer                 # active layer of this page

rect = layer.CreateRectangle2(0, 0, 100, 50)   # Create calls must hang off layer
print("Rectangle drawn on this page")

About this section: Page

Page — pages and page setup.

Other entries in this section