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

Delete element problem

WalterWhite
Participant

Hi there,

I use "ACAPI_Notify_CatchNewElement" to catch the modify of the element.

 

ACAPI_Notify_CatchNewElement(nullptr, ElementEventHandlerProc);
ACAPI_Notify_InstallElementObserver(ElementEventHandlerProc);

 

When I delete the wall element,I can get the "APINotifyElement_Delete" message.However, if I delete a wall which has intersaction with other element, I just can get the delete message but not a modify message which may occured on other elements.Here's the figure1 that I create two wall.and figure2 shows that i delete one of the wall but I can just catch the delete event,so the other wall remains a hole.

 

So is there some way that I can get the modify?


f1.pngf2.png
1 REPLY 1

Hi!


I tried it and I also couldn't get a modify message.
Another thing I tried was getting the Wall Relation on the deleted Wall Element. (https://archicadapi.Graphisoft.com/documentation/acapi_element_getrelations) Unfortunately this doesn't seem to work either, since I think the API considers the Wall already deleted when entering Handler with the delete notification. (Also doesn't work for ACAPI_Notify_GetParentElement).


The only thing that keeps working for me during the APINotifyElement_Delete notification are Element Links: https://archicadapi.Graphisoft.com/documentation/acapi_element_getlinks

So if you have a way to create such links for those touching walls, than you can also query the links during the delete event.

 

Hope this helps!

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: bschwb.com