This commit is contained in:
Christian Anetzberger
2026-01-22 20:23:51 +01:00
commit a197de9456
4327 changed files with 1235205 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# Copyright (c) 2024, Manfred Moitzi
# License: MIT License
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from ezdxf.document import Drawing
class Messenger:
def __init__(self, doc: Drawing) -> None:
self.doc = doc
self.entitydb = doc.entitydb
def broadcast(self, message_type: int, data: Any = None) -> None:
"""Broadcast a message to all entities in the entity database."""
# Receiver can change the entity database while processing the message.
for entity in list(self.entitydb.values()):
entity.notify(message_type, data)