Home/ Reference/ Pitfalls

No sleep: CorelDRAW appears to hang

Rapid-fire calls trigger COM busy errors. 0.2 s for property work, 0.5 s for image imports.

Symptom

No sleep: CorelDRAW appears to hang

Notes

Rapid-fire calls trigger COM busy errors. 0.2 s for property work, 0.5 s for image imports.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
import time

layer = doc.ActivePage.ActiveLayer

for i in range(10):
    rect = layer.CreateRectangle2(i * 20/25.4, 0, 15/25.4, 15/25.4)
    rect.Fill.UniformColor.RGBAssign(200, 200, 200)
    time.sleep(0.2)                  # without this CorelDRAW hangs easily
print("10 rectangles drawn")

About this section: Pitfalls

Pitfalls — errors that fail without raising.

Other entries in this section