2026-06-25 09:54 AM
If I understand it correctly, the benefit of ACAPI_AddOnObject_* methods over ACAPI_ModulData_* is that you can a) perform changes inside an undo scope and b) sync the data to the server (and other people). But how can I react to this happening?
I'd like to know when there are changes to AddOnObjects due to undo/redo or sync with server, but I couldn't find any events handling this. What are the methods I need to use for this? e.g. ACAPI_Element_AttachObserver does not work, AddOnObjects are no real objects despite being addressed via GUID.
Operating system used: Windows
2026-06-26 02:19 PM - edited 2026-06-26 02:19 PM
Hi,
Please check here: Archicad 29 C++ API: Add-On Objects
It states the requirements for the notifications to work. Please report it if it still doesn't work.
Best regards,
Tamás
2026-06-26 04:40 PM
The methods you mentioned do work, but they don't cover the scenario I'm interested in. The user performing undo/redo does not call the installed handlers, only load/save of an older archicad file format does so.
2026-06-29 06:55 PM
Hi,
Please clarify, is it with Undo/Redo that you don't get notifications. Do notifications for create and delete elements work?
Best regards,
Tamás
2026-06-30 09:09 AM
I want to get notified whenever the user performs undo/redo that includes an added/deleted/changed AddOnObject, and I can't find an API for that.
ACAPI_Element_AttachObserver does not work with GUIDs from AddOnObjects.
ACAPI_AddOnObject_RegisterAddOnObjectHandler/ACAPI_AddOnObject_InstallAddOnObject...Handler does not trigger for undo/redo.
2026-07-08 11:42 AM
Hi,
I can only think of a workaround for this. Perhaps you should maintain a table in the addon that connects element guids to addOnObject guids.
On opening/joining a plan go through all the elements, build a table, then maintain it by notifications on create/delete/undo/redo.
Your addon should be resident for this, so it's not unloaded after use.
Regards,
Tamás
3 weeks ago
Sorry, but this workaround doesn't help me at all. If it made sense to attach data to elements I wouldn't need AddOnObjects in the first place and could use other means of storing data, e.g. ACAPI_Element_SetUserData. I use ACAPI_ModulData_* (or ACAPI_AddOnObjects_*) to store data that is not connected to any elements.
3 weeks ago
Hi,
As I understood, the AddOn needs to maintain a table or database that can be updated according to the user's actions, adding, changing, deleting.
Regards,
Tamás
2 weeks ago
Exactly, I need notifications for added/changed/deleted AddOnObjects to maintain the data, and I can't find these notifications. I know the changes that my code is doing itself, but the user can perform undo/redo, and there is no way of me knowing when this happens.
The alternative is polling, e.g. read all AddOnObjects every 10 milliseconds, but I don't really like this approach because it might be a performance problem with many and/or large AddOnObjects.