Copy link to clipboard
Copied
Hi,
Is it possible to purge the Undo Cache via Script or SDK? I'm dealing with quite heavy files, duplicating, moving around, making clipping masks etc. 32GB Ram fills up and crashes some documents. I'm confident that it's the undos that's eating the Ram because twice as much Ram is being used when I change from 50 to 100 Undos in the settings.
Thanks!
(I posted a version of this about 5 years ago, but didn't get a definite answer back then.)
You can purge it with the SDK for sure, I've done it. From AIUndo.h:
/** Forgets all redoable transactions.
Any redos available at this point are forgotten.
This decreases the available redo transactions to 0.
@param document The document on which to perform the operation..
*/
AIAPI AIErr (*ForgetRedos) ( AIDocumentHandle document );
/** Forgets all future transactions and commits all
current and past transactions. Post this the transaction
queue is empty. */
AIAPI AIErr (*Clear
...
Thank you! Got the "newest" SDK to work and with that also the ClearHistory and ForgetRedos so it's all good now. In my "old" 2020 SDK reference manual those functions are omitted. They also got red-lined in my IDE. weird.
Copy link to clipboard
Copied
You can purge it with the SDK for sure, I've done it. From AIUndo.h:
/** Forgets all redoable transactions.
Any redos available at this point are forgotten.
This decreases the available redo transactions to 0.
@param document The document on which to perform the operation..
*/
AIAPI AIErr (*ForgetRedos) ( AIDocumentHandle document );
/** Forgets all future transactions and commits all
current and past transactions. Post this the transaction
queue is empty. */
AIAPI AIErr (*ClearHistory) ( AIDocumentHandle document );
Copy link to clipboard
Copied
Awesome!, I didn't find it in my manual since I'm stuck with the 2020 SDK. Theese functions seem to be brand new. Going to try to get the Newer SDK to run, I'm eager to try this.
Copy link to clipboard
Copied
It's been there going back at least 15 years, but I just checked and apparently they changed the API at some point. In CS6, it was:
AIAPI AIErr (*PurgeAllUndos) ( void );
But in CS6, it was marked as deprecated, so I guess they eventually replaced it with ClearHistory().
Copy link to clipboard
Copied
Thank you! Got the "newest" SDK to work and with that also the ClearHistory and ForgetRedos so it's all good now. In my "old" 2020 SDK reference manual those functions are omitted. They also got red-lined in my IDE. weird.
Copy link to clipboard
Copied
Huh, you're right: none of them are in v24. So there must have been a few releases without anything. Funny! Good thing I never needed it! And good thing you can use it now 😁