cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
SimonWeinberger
Contributor

How to react to AddOnObject changes?

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

5 Replies 5
Tamas Polyak
Graphisoft
Graphisoft

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

SimonWeinberger
Contributor

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.

Tamas Polyak
Graphisoft
Graphisoft

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

SimonWeinberger
Contributor

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.

Tamas Polyak
Graphisoft
Graphisoft

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

 

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!