I created a code that is inside undoable block. This code generates texts, lines, and hatch (fill) on a worksheet. I can see that those items were generated. (I use APIDo_ZoomID so that the items will be visible every time.)
After generating all the items, they were removed immediately as if Undo button was clicked. But checking on the Undo/Redo button list, no evidence that the action was done.
ARCHICAD 24 INT 4018 FULL (from AC18)
Windows 10 Pro, Intel Core i7-4790 CPU @ 3.60GHz, 32.0GB RAM, 64-bit OS