API Documentation > CorelDRAW > 2025-v26 > Application > IVGApplication
Application.Optimization property
Gets or sets whether to use optimization
Syntax:
Property Get Optimization() As Boolean
Property Let Optimization(ByVal Value As Boolean)
Remarks:
The Optimization property returns or specifies the optimization, the ability to suppress screen redraws when working with documents and shapes. Setting the Optimization property to True disables some internal updating. It is important to disable optimization when exiting a macro, or CorelDRAW may not update its screens. You may also want to refresh the document window after disabling optimization so the display is updated and reflects all changes.
Examples:
The following VBA example creates 100 random circles in the active document, with optimization enabled for increased performance.
Sub Optimize()
Dim i As Long
Dim x As Double, y As Double, r As Double
Dim n As Long
Dim num As Long
Dim MaxX As Double, MaxY As Double, MaxR As Double
MaxX = ActivePage.SizeWidth
MaxY = ActivePage.SizeHeight
MaxR = 1
num = ActivePalette.ColorCount
Optimization = True
For i = 1 To 100
  x = Rnd() * MaxX
  y = Rnd() * MaxY
  r = Rnd() * MaxR
  n = CLng(Fix(Rnd() * num)) + 1
  Set s = ActiveLayer.CreateEllipse2(x, y, r)
  s.Fill.ApplyUniformFill ActivePalette.Color(n)
Next i
Optimization = False
ActiveWindow.Refresh 
End Sub