How to avoid Undo junk?

Hello, all!

So there's a thing that has been annoying me ever since I learned to use CommandGroup - it does group the actions, but it still redraws selection nodes when undoing. Here's an example:

Sub UndoJunk()

ActiveDocument.BeginCommandGroup "UndoJunk"

Dim A As Integer
Dim S As Shape
Set S = ActiveLayer.CreateEllipse2(0, 0, 1)

For A = 0 To 100

S.Move 1, 0

Next A

ActiveDocument.EndCommandGroup

End Sub

When you undo you get this line of dots that takes quite a while to redraw, especially if you had a decent amount of operations. For this simple example VirtualLayers may be the answer, but in my case I'm doing some more advanced things which involve checking for curve intersections using DisplayCurve, IntersectsWith, IsPointInside etc.

So my question is - is there a way to avoid this undo junk and just instantly jump back a step?

I'm on X6, btw, perhaps this has been fixed in following versions, who knows.

Parents
No Data
Reply
  • I think this is an issue with X6. We have an X5 environment that does something very similar to this and within a BeginCommandGroup with optimization turned on, it takes 30 to 60 seconds to draw 100+ rectangles. This is in VBA code.

    We are currently porting the code to CorelDraw 2017 and the exact same code, this time in C#, runs instantly and the undo is instantaneous too.

    For reference, I have done development work CorelDraw X5, X7, X8, and 2017 and X8 and 2017 are much much faster than X5. X7 also seems to be faster. Everything we do usually speeds up by 90% in X8/2017 over X5.
Children
No Data