[PythonCAD] DWG Reader update

Art Haas ahaas at airmail.net
Tue Sep 2 13:32:51 EDT 2003


The drawings on the lx-viewer site have been great for flushing out
bugs. The pointed out a bug reading the extended entity data - a patch
for which I've included in this mail.

Other drawings which I have been sent are failing when reading the
second header section. This is disturbing because the drawings are
following the layout described in the OpenDWG spec. I'll be working on
this stuff today.

The patch below fixes a trivial byte count typo and makes most of the
current lx-viewer drawings work. There is still one or two other errors
two fix.


Index: Generic/dwg.py
--- Generic/dwg.py	(revision 645)
+++ Generic/dwg.py	(working copy)
@@ -3850,7 +3850,7 @@
                     for _i in xrange(8):
                         _bitpos, _char = get_raw_char(_data, _bitpos)
                         print "char: %#02x" % _char
-                    _count = _count + 1
+                    _count = _count + 8
                 elif (0xa <= _cb <= 0xd):
                     print "three doubles"
                     _bitpos, _d = get_raw_double(_data, _bitpos)
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822

More information about the PythonCAD mailing list