We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

ACAPI_CallUndoableCommand() gets cancelled

ReignBough
Enthusiast

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.

~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Hi,

 

It's definitely strange what's happening there. Maybe the command actually aborts due to some reason (out of memory or something like that) and thus AC cleans up by reverting everything.

Was your command done or do you expect more output?

 

And is the error code of the ACAPI_CallUndoableCommand ok?

View solution in original post

3 REPLIES 3
Solution

Hi,

 

It's definitely strange what's happening there. Maybe the command actually aborts due to some reason (out of memory or something like that) and thus AC cleans up by reverting everything.

Was your command done or do you expect more output?

 

And is the error code of the ACAPI_CallUndoableCommand ok?

Hi,

 

That usually happens when one of the commands inside results in an exception. This may come from incorrect data passed into Archicad.

Another reason could be that you call this function within a non-standard scope, for example in a notification handler, where a differently scoped undo is needed.

 

Could you please tell us more details?

 

Thanks, Ákos

I did not check the return of the undoable block. And upon checking, there was indeed an exception.

 

I already fixed it. Thanks.

~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS