Home/ Reference/ Document

doc.Unit

Document unit (cdrUnit). Every geometric value follows it: shape coordinates and sizes, page width and height, outline widths. The /25.4 scattered through the code t

Signature

doc.Unit

Notes

Document unit (cdrUnit). Every geometric value follows it: shape coordinates and sizes, page width and height, outline widths. The /25.4 scattered through the code tells you this document is set to inches. Probe it first on any new machine.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
u = doc.Unit                            # document unit code (values differ between versions)
print("Unit code: ", u)

# safest check: measure a shape of known size and derive the factor
page = doc.ActivePage
print("Page width value: ", page.SizeWidth, "  <- this number is in doc.Unit")

About this section: Document

Document — documents and file handling.

Other entries in this section