Home/ Reference/ View & Performance

app.Optimization

The performance switch. Turning off screen redraw makes batch output several times faster. Turn it back on afterwards or you'll think CorelDRAW has hung.

Signature

app.Optimization

Notes

The performance switch. Turning off screen redraw makes batch output several times faster. Turn it back on afterwards or you'll think CorelDRAW has hung.

Python example (runnable)

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

print("Optimisation was: ", app.Optimization)

app.Optimization = True                             # disable redraw to go fast
t0 = time.time()

shapes = app.ActiveSelectionRange
for i in range(1, shapes.Count + 1):
    shapes.Item(i).Fill.ApplyUniformFill(app.CreateRGBColor(0, 133, 205))

app.Optimization = False                            # re-enable redraw
print("Processed ", shapes.Count, " object(s) in ", round(time.time() - t0, 2), "s")

About this section: View & Performance

View & Performance — display and performance switches.

Other entries in this section