Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: TheTwo on May 30, 2008, 06:36:52 pm
-
Hi,
i'd like to use the method "EA_OnPreDeleteElement()" to deside if the output has to be changed or not.
How can I check if only a DiagramObject or an Element (Class) will be deleted?
The EventProperties variable only contains the ElementID and a check if the Element exsits doesn't work, because it is a pre deletion event.
Thanks
TheTwo
-
Is the EA_OnPreDeleteElement actually fired when a user only deletes an element from a diagram?
Help says
EA_OnPreDeleteElement notifies Add-Ins that an element is to be deleted from the model
but then it says
This event occurs when a user deletes an element from the Project Browser window or on a diagram
I take the second to mean that the event is fired when a user presses Ctrl+Del for an element selected in a diagram. This would mean, however, that you get no event at all when the user only removes an element from a diagram.
-
The problem is that when deleting only an DiagramObject from an Diagram with Del the event is fired, too.
-
The problem is that when deleting only an DiagramObject from an Diagram with Del the event is fired, too.
This is a downright bug then, cause documentation explicitly states that the event is fired when an element is about to be deleted from the model.
Or maybe only documentation is wrong, and the event is supposed to be fired in this case as well. But then the ElementID in the event properties should actually be the InstanceID of the DiagramObject.