diff options
Diffstat (limited to 'io_import_dxf/dxfgrabber/sections.py')
-rwxr-xr-x | io_import_dxf/dxfgrabber/sections.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/io_import_dxf/dxfgrabber/sections.py b/io_import_dxf/dxfgrabber/sections.py index 286ebf09..c1b03714 100755 --- a/io_import_dxf/dxfgrabber/sections.py +++ b/io_import_dxf/dxfgrabber/sections.py @@ -8,6 +8,7 @@ __author__ = "mozman <mozman@gmx.at>" from .codepage import toencoding from .defaultchunk import DefaultChunk, iterchunks from .headersection import HeaderSection +from .headersection import MinVersionError from .tablessection import TablesSection from .entitysection import EntitySection, ObjectsSection from .blockssection import BlocksSection @@ -29,6 +30,11 @@ class Sections(object): section = cls() self._sections[section.name] = section + def check_min_version(self, version_string): + v = int(version_string.replace("AC", "")) + if v < 1009: + raise MinVersionError(version_string) + def _setup_sections(self, tagreader, drawing): def name(section): return section[1].value @@ -38,6 +44,7 @@ class Sections(object): if bootstrap: new_section = HeaderSection.from_tags(section) drawing.dxfversion = new_section.get('$ACADVER', 'AC1009') + self.check_min_version(drawing.dxfversion) codepage = new_section.get('$DWGCODEPAGE', 'ANSI_1252') drawing.encoding = toencoding(codepage) bootstrap = False |