Skip to content

Commit

Permalink
Merge pull request #1195 from gswifort/patch-2
Browse files Browse the repository at this point in the history
Insert.add_auto_attribs() support default values
  • Loading branch information
mozman authored Nov 7, 2024
2 parents 36bead1 + 5dd0183 commit 83b5336
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ezdxf/entities/insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 83b5336

Please sign in to comment.