2015-02-20
11:26 AM
- last edited on
2023-08-01
01:37 PM
by
Doreena Deng
APINotifyElement_Change APINotifyElement_Edit APINotifyElement_Undo_Modified APINotifyElement_Redo_ModifiedI am also using the quantities to get the area (ACAPI_Element_GetQuantities()).
ORIGINAL_AREA = 100APINotifyElement_Edit is called:
ORIGINAL_AREA = 100 QUANTITY_AREA = 150 (let say that this is the "new" area)I save the new value:
ORIGINAL_AREA = 150APINotifyElement_Undo_Modified is called:
ORIGINAL_AREA = 150 QUANTITY_AREA = 150Since it is undo, I am expecting that quantity value should be 100.
2015-02-23 04:00 AM
GSErrCode __ACENV_CALL MyElemObserver(const API_NotifyElementType* iElemType)
{
switch (iElemType->notifID)
{
// ...other notify ids...
case APINotifyElement_EndEvents:
switch (g_LastEvent.notifID)
{
case APINotifyElement_Undo_Modified: //<== handle here
case APINotifyElement_Redo_Modified: //<== handle here
Foo(g_LastEvent.elemHead.guid);
break;
}
break;
}
g_LastEvent = *iElemType; //<== save here
return NoError;
};
2015-03-05 10:27 AM
ReignBough wrote:That's not a hack. The begin/end structure of the notification process allows you to cache all the elements involved in a transaction and batch process them at the end.
I found a hack to this problem.
I created a global variable where i save the value of API_NotifyElementType. I will then process it on APINotifyElement_EndEvents.