From 5dd01839f7b91588a6641843847d3e5ffeacc7e8 Mon Sep 17 00:00:00 2001 From: Grzegorz <131259064+gswifort@users.noreply.github.com> Date: Thu, 7 Nov 2024 08:17:51 +0100 Subject: [PATCH] Insert.add_auto_attribs() support default values --- src/ezdxf/entities/insert.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ezdxf/entities/insert.py b/src/ezdxf/entities/insert.py index 8320ad04b..638a5c433 100644 --- a/src/ezdxf/entities/insert.py +++ b/src/ezdxf/entities/insert.py @@ -721,7 +721,9 @@ def add_auto_attribs(self, values: dict[str, str]) -> Insert: def unpack(dxfattribs) -> tuple[str, str, UVec]: tag = dxfattribs.pop("tag") - text = values.get(tag, "") + text = values.get(tag, None) + if text is None: # get default value + text = dxfattribs.pop("text") location = dxfattribs.pop("insert") return tag, text, location