Home/ Reference/ Layer Advanced

layer.CreateGuide(X, Y, Angle)

Creates a guide on the layer. For consistent margins and type areas, lay the guides down by script — more accurate than dragging.

Signature

layer.CreateGuide(X, Y, Angle)

Notes

Creates a guide on the layer. For consistent margins and type areas, lay the guides down by script — more accurate than dragging.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
layer = doc.ActivePage.GuidesLayer                  # a layer just for guides

try:
    layer.CreateGuide(10 / 25.4, 10 / 25.4, 0)       # position plus angle
    print("Guide added")
except Exception as e:
    print("Adding a guide failed; the arguments may be X, Y, Angle: ", e)

print("Guides on this page: ", doc.ActivePage.Guides.Count)

About this section: Layer Advanced

Layer Advanced — multi-layer and multi-page workflows.

Other entries in this section