Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

ACAPI_CallUndoableCommand() gets cancelled

ReignBough
Booster

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 24 INT 4018 FULL (from AC18)
Windows 10 Pro, Intel Core i7-4790 CPU @ 3.60GHz, 32.0GB RAM, 64-bit OS
1 ACCEPTED SOLUTION

Solution
bschwb
Booster

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?

Bernd Schwarzenbacher
Archicad Add-On Developer
AC 24-25, VS 2019

Get free Add-Ons at www.bschwb.com/add-ons

View solution in original post

3 REPLIES 3

Solution
bschwb
Booster

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?

Bernd Schwarzenbacher
Archicad Add-On Developer
AC 24-25, VS 2019

Get free Add-Ons at www.bschwb.com/add-ons

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 24 INT 4018 FULL (from AC18)
Windows 10 Pro, Intel Core i7-4790 CPU @ 3.60GHz, 32.0GB RAM, 64-bit OS

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!