We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

How To Hook And Cancel When Delete Element

Kouichi
Participant

Please Teach me.

How To Hook And Cancel When Delete Element.

I catch DELETE Handler 

 

static GSErrCode __ACENV_CALL ElementEventHandler(const API_NotifyElementType *elemType) {
GSErrCode err = NoError;
switch (elemType->notifID) {
case APINotifyElement_Delete:

//  I hope Cancel Delete Command By Guid

break;
default:
err = APIERR_NOTSUPPORTED;
break;
};//sw
return(err);

}

//-------------------------------------

void SetHandler() {

//Get Guid List

...





//Set Handle for Delete Command

ACAPI_Notify_InstallElementObserver(ElementEventHandler);

for (auto& guid: GuidList) {
  err = ACAPI_Element_AttachObserver(guid);
}

}

 

0 REPLIES 0