Check if the event is registered or not

Check if the event is registered or not

NhuTruong_BeyCons
Contributor Contributor
442 Views
1 Reply
Message 1 of 2

Check if the event is registered or not

NhuTruong_BeyCons
Contributor
Contributor

Hi all, how to check if a registered event will not register or delete the previous registration event to register a new event, if there is no event in the document, register new. Thank you.

0 Likes
443 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

I am not aware of any method to check whether the event has already been registered or not.

 

You can register it using the `+-` operator and unregister again using `-=`.

 

I normally keep track of the registration state using a a Boolean variable or by switching some variable between a non-null initialised state and `null`.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes