Skip to content

Commit 6d0634e

Browse files
committed
fix FIELDLIST entity
- Handles were loaded from wrong subclass. - Handles were exported to wrong subclass.
1 parent 3ffaf31 commit 6d0634e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/ezdxf/entities/idbuffer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ def load_dxf_attribs(
9595
)
9696
processor.fast_load_dxfattribs(dxf, acdb_id_set_group_codes, 1)
9797
# Load field list:
98-
self.load_handles(processor.subclasses[2])
98+
self.load_handles(processor.subclasses[1])
9999
return dxf
100100

101101
def export_entity(self, tagwriter: AbstractTagWriter) -> None:
102102
"""Export entity specific data as DXF tags."""
103103
super(DXFObject, self).export_entity(tagwriter)
104104
tagwriter.write_tag2(SUBCLASS_MARKER, acdb_id_set.name)
105105
self.dxf.export_dxf_attribs(tagwriter, "flags")
106-
tagwriter.write_tag2(SUBCLASS_MARKER, acdb_field_list.name)
107106
self.export_handles(tagwriter)
107+
tagwriter.write_tag2(SUBCLASS_MARKER, acdb_field_list.name)
108108

109109

110110
acdb_filter = DefSubclass("AcDbFilter", {})

tests/test_01_dxf_entities/test_131_field_list.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ def test_set_get_field_list(doc):
8989
def test_dxf_tags(doc):
9090
buffer = cast(FieldList, doc.objects.new_entity("FIELDLIST", {}))
9191
buffer.handles = ["FF", "EE", "DD", "CC"]
92-
tags = TagCollector.dxftags(buffer)[-4:]
92+
tags = TagCollector.dxftags(buffer)
9393

94-
assert len(tags) == 4
95-
assert tags[0] == (330, "FF")
96-
assert tags[-1] == (330, "CC")
94+
assert len(tags) == 10
95+
assert tags[5] == (330, "FF")
96+
assert tags[8] == (330, "CC")
97+
assert tags[-1] == (100, "AcDbFieldList")
9798

9899

99100
def test_clone(doc):

0 commit comments

Comments
 (0)