Share

RepresentationEvents.OnDelete Event

Parent Object: RepresentationEvents

Description

The OnDelete event notifies the client when any representation related objects are deleted. These include positional representations and design views.

Syntax

RepresentationEvents.OnDelete( DocumentObject As Document, Entity As Object, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, HandlingCode As HandlingCodeEnum )

Parameters

Name Type Description
DocumentObject Document The Document object the deleted object is within.
Entity Object The representation that is being deleted. When the value of the BeforeOrAfter argument is kBefore, the object provided is the object before being deleted. When the value is kAfter, an object is also provided but since the actual entity has been deleted calling any methods or properties on the object will fail. The only thing that is valid to do with the object at this time is to compare it's identity with a reference previously saved. For example: Private m_oDeletedEntity As Object Private Sub oRepresentationEvents_OnDelete(ByVal DocumentObject As Document, ByVal Entity As Object, ByVal BeforeOrAfter As EventTimingEnum, ...) If BeforeOrAfter = kBefore Then ' Somehow Check to see if the representation being deleted is an interesting one. If Interesting(Entity) Then ' Save a reference to the object. Set m_oDeletedEntity = Entity End If Else ' Now we're either after the delete or it's been aborted. ' Check to see if the object is the interesting one. If Entity is m_oDeletedEntity Then If BeforeOrAfter = kAfter then ' The object was deleted. ElseIf BeforeOrAfter = kAbort Then ' The delete was aborted. End If End If End Sub
BeforeOrAfter EventTimingEnum Input EventTimingEnum indicating when the event is being fired. Notification is sent before and after the object is deleted.
Context NameValueMap Input NameValueMap object that can be used to determine the context of why the event fired. No context information is provided for this event.
HandlingCode HandlingCodeEnum Output HandlingCodeEnum that indicates how you are handling the event. The value of this argument is currently ignored for this event.

Version

Introduced in version 11

Was this information helpful?