Skip to content

Commit

Permalink
updating to newest version of dxfgrabber; needed for further updates …
Browse files Browse the repository at this point in the history
…regarding inf.0 problem.
  • Loading branch information
Lukas Treyer committed Aug 16, 2016
1 parent b79cc04 commit 37939a3
Show file tree
Hide file tree
Showing 31 changed files with 537 additions and 2,473 deletions.
27 changes: 12 additions & 15 deletions io_import_dxf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import os
from bpy.props import StringProperty, BoolProperty, EnumProperty, IntProperty, FloatProperty
from .dxfimport.do import Do, Indicator
from .dxfgrabber.headersection import MinVersionError
from .transverse_mercator import TransverseMercator


Expand Down Expand Up @@ -114,20 +113,18 @@ def read(report, filename, obj_merge=BY_LAYER, import_text=True, import_light=Tr
thicknessWidth=True, but_group_by_att=True, dxf_unit_scale=1.0):
# import dxf and export nurbs types to sat/sab files
# because that's how autocad stores nurbs types in a dxf...
try:
do = Do(filename, obj_merge, import_text, import_light, export_acis, merge_lines, do_bbox, block_rep, recenter,
projDXF, projSCN, thicknessWidth, but_group_by_att, dxf_unit_scale)
errors = do.entities(os.path.basename(filename).replace(".dxf", ""), new_scene)

# display errors
for error in errors:
report({'ERROR', 'INFO'}, error)

# inform the user about the sat/sab files
if len(do.acis_files) > 0:
report({'INFO'}, "Exported %d NURBS objects to sat/sab files next to your DXF file" % len(do.acis_files))
except MinVersionError as minv:
report({'ERROR', 'INFO'}, str(minv))
do = Do(filename, obj_merge, import_text, import_light, export_acis, merge_lines, do_bbox, block_rep, recenter,
projDXF, projSCN, thicknessWidth, but_group_by_att, dxf_unit_scale)

errors = do.entities(os.path.basename(filename).replace(".dxf", ""), new_scene)

# display errors
for error in errors:
report({'ERROR', 'INFO'}, error)

# inform the user about the sat/sab files
if len(do.acis_files) > 0:
report({'INFO'}, "Exported %d NURBS objects to sat/sab files next to your DXF file" % len(do.acis_files))


def display_groups_in_outliner():
Expand Down
2 changes: 1 addition & 1 deletion io_import_dxf/dxfgrabber/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Created: 21.07.2012
# License: MIT License

version = (0, 7, 4)
version = (0, 8, 1)
VERSION = "%d.%d.%d" % version

__author__ = "mozman <[email protected]>"
Expand Down
4 changes: 2 additions & 2 deletions io_import_dxf/dxfgrabber/acdsdata.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def __init__(self):
@classmethod
def from_tags(cls, tags, drawing):
data_section = cls()
data_section._build(tags, drawing.dxfversion)
data_section._build(tags)
return data_section

def _build(self, tags, dxfversion):
def _build(self, tags):
if len(tags) == 3: # empty entities section
return

Expand Down
6 changes: 3 additions & 3 deletions io_import_dxf/dxfgrabber/blockssection.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ def __init__(self):
def from_tags(tags, drawing):
blocks_section = BlocksSection()
if drawing.grab_blocks:
blocks_section._build(tags, drawing.dxfversion)
blocks_section._build(tags)
return blocks_section

def _build(self, tags, dxfversion):
def _build(self, tags):
if len(tags) == 3: # empty block section
return
groups = list()
for group in TagGroups(islice(tags, 2, len(tags)-1)):
groups.append(group)
if group[0].value == 'ENDBLK':
entities = build_entities(groups, dxfversion)
entities = build_entities(groups)
block = entities[0]
block.set_entities(entities[1:-1])
self._add(block)
Expand Down
Empty file modified io_import_dxf/dxfgrabber/codepage.py
100755 → 100644
Empty file.
Empty file modified io_import_dxf/dxfgrabber/color.py
100755 → 100644
Empty file.
Empty file modified io_import_dxf/dxfgrabber/const.py
100755 → 100644
Empty file.
7 changes: 0 additions & 7 deletions io_import_dxf/dxfgrabber/cydxfentity.py

This file was deleted.

7 changes: 0 additions & 7 deletions io_import_dxf/dxfgrabber/cytags.py

This file was deleted.

Empty file modified io_import_dxf/dxfgrabber/decode.py
100755 → 100644
Empty file.
5 changes: 2 additions & 3 deletions io_import_dxf/dxfgrabber/defaultchunk.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@


class DefaultChunk(object):
def __init__(self, tags, drawing):
def __init__(self, tags):
assert isinstance(tags, Tags)
self.tags = tags
self._drawing = drawing

@staticmethod
def from_tags(tags, drawing):
return DefaultChunk(tags, drawing)
return DefaultChunk(tags)

@property
def name(self):
Expand Down
4 changes: 2 additions & 2 deletions io_import_dxf/dxfgrabber/drawing.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__author__ = "mozman <[email protected]>"

from .tags import TagIterator
from .tags import stream_tagger
from .sections import Sections

DEFAULT_OPTIONS = {
Expand All @@ -23,7 +23,7 @@ def __init__(self, stream, options=None):
self.assure_3d_coords = options.get('assure_3d_coords', False)
self.resolve_text_styles = options.get('resolve_text_styles', True)

tagreader = TagIterator(stream, self.assure_3d_coords)
tagreader = stream_tagger(stream, self.assure_3d_coords)
self.dxfversion = 'AC1009'
self.encoding = 'cp1252'
self.filename = None
Expand Down
202 changes: 0 additions & 202 deletions io_import_dxf/dxfgrabber/dxf12.py

This file was deleted.

Loading

0 comments on commit 37939a3

Please sign in to comment.