The following are snippets of example code using custom undo.
Simple Undo
int undoId = beginaggregatedundo(c, "Set Object Rank"); setrank(anObj, 5); endaggregatedundo(c, undoId);
Undo with an Ignore
int undoId = beginaggregatedundo(c, "Change Object Shape"); setnodestr(shape(anObj), shapePath); int index = getshapeindex(gets(shape(anObj))); beginignoreundo(); if (getshapeindex(shapePath)==0) { autoloadallmedia(anObj); index = getshapeindex(gets(shape(anObj))); } endignoreundo(); set(shapeindex(anObj), index); applyshapefactors(anObj); endaggregatedundo(c, undoId);