Skip to content

events

Event telemetry management.

Attributes

mlogger = logger.get_logger(__name__) module-attribute

ALL_EVENTS = 340282366920938463463374607431768211455 module-attribute

SUGGESTED_EVENTS = 31988513242969 module-attribute

Functions

register_event_telemetry(handler, flags)

Registers application event telemetry handlers based on given flags.

Parameters:

Name Type Description Default
handler EventTelemetry

event telemetry handler

required
flags int

event flags

required
Source code in pyrevitlib/pyrevit/telemetry/events.py
def register_event_telemetry(handler, flags):
    """Registers application event telemetry handlers based on given flags.

    Args:
        handler (EventTelemetry): event telemetry handler
        flags (int): event flags
    """
    try:
        handler.RegisterEventTelemetry(HOST_APP.uiapp, flags)
    except Exception as ex:
        mlogger.debug(
            "Error registering event telementry with flags: %s | %s",
            str(flags), ex)

unregister_event_telemetry(handler, flags)

Unregisters application event telemetry handlers based on given flags.

Parameters:

Name Type Description Default
handler EventTelemetry

event telemetry handler

required
flags int

event flags

required
Source code in pyrevitlib/pyrevit/telemetry/events.py
def unregister_event_telemetry(handler, flags):
    """Unregisters application event telemetry handlers based on given flags.

    Args:
        handler (EventTelemetry): event telemetry handler
        flags (int): event flags
    """
    try:
        handler.UnRegisterEventTelemetry(HOST_APP.uiapp, flags)
    except Exception as ex:
        mlogger.debug(
            "Error unregistering event telementry with flags: %s | %s",
            str(flags), ex)

unregister_all_event_telemetries(handler)

Unregisters all available application event telemetry handlers.

Source code in pyrevitlib/pyrevit/telemetry/events.py
def unregister_all_event_telemetries(handler):
    """Unregisters all available application event telemetry handlers."""
    unregister_event_telemetry(handler, ALL_EVENTS)