We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2024-04-26 12:07 PM - last edited on 2024-09-17 11:03 AM by Doreena Deng
Hi all,
I've been working on trying to change GDL object parameters automatically when the user saves the project file.
static GSErrCode __ACENV_CALL ProjectEventHandlerProc(API_NotifyEventID notifID, Int32 param) {
switch (notifID) {
case APINotify_PreSave: {
ACAPI_CallUndoableCommand("Hide", [&]() -> GSErrCode {
HideStuff(parameter, 0);
return NoError; });
break;
}
case APINotify_Save: {
ACAPI_CallUndoableCommand("Hide", [&]() -> GSErrCode {
HideStuff(parameter, 1);
return NoError; });
break;
}
break;
}
return NoError;
}
The object has a parameter to be hidden when the value is False and shown when it's True. Currently the function works fine when called during a PreSave, but ArchiCAD crashes when I try to call it during a Save. Is it possible to call undoable commands during a save function?
If not, is it possible within the API to just undo the previous command as if a user had clicked undo?
Thanks
2024-05-10 09:26 AM
Hi Rob,
Could you please give us a bug report ID related to this crash?
The definition of the HideStuff function would be helpful. Or the list of the API functions you call inside it.
The minimum steps to reproduce this crash with a new plan also would be a big help.
Regards,
Ákos
2024-05-14 02:00 PM
Have you been able to debug into the add-on? If so, where did the crash happen and what was the stack trace leading to it?