def post_load_hook(self, doc: 'Drawing') -> None:
    super().post_load_hook(doc)
    db_get = doc.entitydb.get

    def entities():
        for handle in self._handles:
            entity = db_get(handle)
            if (entity and entity.is_alive):
                (yield entity)
    try:
        self.set_data(entities())
    except const.DXFStructureError as e:
        logger.error(str(e))
    del self._handles
def post_load_hook(self, doc: 'Drawing') -> None:
    super().post_load_hook(doc)
    db_get = doc.entitydb.get

    def entities():
        for handle in self._handles:
            entity = db_get(handle)
            if (entity and entity.is_alive):
                (yield entity)
    try:
        self.set_data(entities())
    except const.DXFStructureError as e:
        logger.error(str(e))
    del self._handles