# Path: core/ezdxf/lldxf/types.py
# NONE_TAG = DXFTag(None, None)
# TAG_STRING_FORMAT = '%3d\n%s\n'
# TYPE_TABLE = _build_type_table([
#     (internal_type, (-10, )),  # spacial tags for internal use
#     (ustr, range(0, 10)),
#     (point_tuple, range(10, 20)),  # 2d or 3d points
#     (float, range(20, 60)),  # code 20-39 belongs to 2d/3d points and should not appear alone
#     (int, range(60, 100)),
#     (ustr, range(100, 106)),
#     (point_tuple, range(110, 113)),  # 110, 111, 112 - UCS definition
#     (float, range(113, 150)),  # 113-139 belongs to UCS definition and should not appear alone
#     (int, range(160, 170)),
#     (int, range(170, 180)),
#     (point_tuple, [210]),  # extrusion direction
#     (float, range(211, 240)),  # code 220, 230 belongs to extrusion direction and should not appear alone
#     (int, range(270, 290)),
#     (int, range(290, 300)),  # bool 1=True 0=False
#     (ustr, range(300, 370)),
#     (int, range(370, 390)),
#     (ustr, range(390, 400)),
#     (int, range(400, 410)),
#     (ustr, range(410, 420)),
#     (int, range(420, 430)),
#     (ustr, range(430, 440)),
#     (int, range(440, 460)),
#     (float, range(460, 470)),
#     (ustr, range(470, 480)),
#     (ustr, range(480, 482)),
#     (ustr, range(999, 1010)),
#     (point_tuple, range(1010, 1020)),
#     (float, range(1020, 1060)),  # code 1020-1039 belongs to 2d/3d points and should not appear alone
#     (int, range(1060, 1072)),
# ])
# def point_tuple(value):
# def _build_type_table(types):
# def internal_type(value):
# def is_point_code(code):
# def is_point_tag(tag):
# def cast_tag(tag, types=TYPE_TABLE):
# def cast_tag_value(code, value, types=TYPE_TABLE):
# def tag_type(code):
# def strtag(tag):
# def strtag2(tag):
# def convert_tags_to_text_lines(line_tags):
# def convert_text_lines_to_tags(text_lines):
# 
# Path: core/ezdxf/lldxf/const.py
# class DXFStructureError(DXFError):
#     pass


from .lldxf.types import cast_tag_value, DXFTag
from .lldxf.const import DXFStructureError
        # no subclass is subclass index 0
        subclasstags = self.tags.subclasses[dxfattr.subclass]
        if dxfattr.xtype is not None:
            self._set_extended_type(subclasstags, dxfattr.code, dxfattr.xtype, value)
        else:
            subclasstags.set_first(dxfattr.code, cast_tag_value(dxfattr.code, value))

    def del_dxf_attrib(self, key):
        dxfattr = self._get_dxfattr_definition(key)
        self._del_dxf_attrib(dxfattr)

    def clone_dxf_attribs(self):
        """ Clones defined and existing DXF attributes as dict.
        """
        dxfattribs = {}
        for key in self.DXFATTRIBS.keys():
            value = self.get_dxf_attrib(key, default=None)
            if value is not None:
                dxfattribs[key] = value
        return dxfattribs

    def update_dxf_attribs(self, dxfattribs):
        for key, value in dxfattribs.items():
            self.set_dxf_attrib(key, value)

    @staticmethod
    def _get_extented_type(tags, code, xtype):
        value = tags.find_first(code)
        if len(value) == 3:
            if xtype == 'Point2D':

# Path: core/ezdxf/lldxf/types.py
# NONE_TAG = DXFTag(None, None)
# TAG_STRING_FORMAT = '%3d\n%s\n'
# TYPE_TABLE = _build_type_table([
#     (internal_type, (-10, )),  # spacial tags for internal use
#     (ustr, range(0, 10)),
#     (point_tuple, range(10, 20)),  # 2d or 3d points
#     (float, range(20, 60)),  # code 20-39 belongs to 2d/3d points and should not appear alone
#     (int, range(60, 100)),
#     (ustr, range(100, 106)),
#     (point_tuple, range(110, 113)),  # 110, 111, 112 - UCS definition
#     (float, range(113, 150)),  # 113-139 belongs to UCS definition and should not appear alone
#     (int, range(160, 170)),
#     (int, range(170, 180)),
#     (point_tuple, [210]),  # extrusion direction
#     (float, range(211, 240)),  # code 220, 230 belongs to extrusion direction and should not appear alone
#     (int, range(270, 290)),
#     (int, range(290, 300)),  # bool 1=True 0=False
#     (ustr, range(300, 370)),
#     (int, range(370, 390)),
#     (ustr, range(390, 400)),
#     (int, range(400, 410)),
#     (ustr, range(410, 420)),
#     (int, range(420, 430)),
#     (ustr, range(430, 440)),
#     (int, range(440, 460)),
#     (float, range(460, 470)),
#     (ustr, range(470, 480)),
#     (ustr, range(480, 482)),
#     (ustr, range(999, 1010)),
#     (point_tuple, range(1010, 1020)),
#     (float, range(1020, 1060)),  # code 1020-1039 belongs to 2d/3d points and should not appear alone
#     (int, range(1060, 1072)),
# ])
# def point_tuple(value):
# def _build_type_table(types):
# def internal_type(value):
# def is_point_code(code):
# def is_point_tag(tag):
# def cast_tag(tag, types=TYPE_TABLE):
# def cast_tag_value(code, value, types=TYPE_TABLE):
# def tag_type(code):
# def strtag(tag):
# def strtag2(tag):
# def convert_tags_to_text_lines(line_tags):
# def convert_text_lines_to_tags(text_lines):
# 
# Path: core/ezdxf/lldxf/const.py
# class DXFStructureError(DXFError):
#     pass


# Path: core/ezdxf/dxfentity.py
from .lldxf.types import cast_tag_value, DXFTag
from .lldxf.const import DXFStructureError

        # no subclass is subclass index 0
        subclasstags = self.tags.subclasses[dxfattr.subclass]
        if dxfattr.xtype is not None:
            self._set_extended_type(subclasstags, dxfattr.code, dxfattr.xtype, value)
        else:
            subclasstags.set_first(dxfattr.code, cast_tag_value(dxfattr.code, value))

    def del_dxf_attrib(self, key):
        dxfattr = self._get_dxfattr_definition(key)
        self._del_dxf_attrib(dxfattr)

    def clone_dxf_attribs(self):
        """ Clones defined and existing DXF attributes as dict.
        """
        dxfattribs = {}
        for key in self.DXFATTRIBS.keys():
            value = self.get_dxf_attrib(key, default=None)
            if value is not None:
                dxfattribs[key] = value
        return dxfattribs

    def update_dxf_attribs(self, dxfattribs):
        for key, value in dxfattribs.items():
            self.set_dxf_attrib(key, value)

    @staticmethod
    def _get_extented_type(tags, code, xtype):
        value = tags.find_first(code)
        if len(value) == 3:
            if xtype == 'Point2D':

                raise DXFStructureError("expected 2D point but found 3D point")