Error during DXf importing (DXF R12)

Bug #1123907 reported by Marvin R on 2013-02-13
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Wishlist
Unassigned

Bug Description

Hi,
I have problem with importing DXf file to Inkscape (v.: 0.48.4 r9939)

Everytime will Inkscape give me this message:

Traceback (most recent call last):

  File "dxf_input.py", line 470, in <module>

    layer = layer_nodes[vals[groups['8']][0]]

KeyError: u'0'

I tried update dxf_input.py and dxf_input.inx at share/extensions without succes

Please help, Thanks Marvin

Marvin R (halon) wrote :

DXF file

su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48.4 and 0.48+devel r12119 on OS X 10.7

tags: added: dxf importing
Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Marvin R (halon) wrote :

additional info: OS: Win 7 prof SP1, exported from CadsoftEagle -> export works at CorelDraw

Alvin Penner (apenner) wrote :

the dxf file appears to be either Release 11 or 12. (One way to check the Release version is to check the variable $ACADVER
 which is AC1009 in this case. )
The current dxf import routine does not support Release 12, only Release 13 and newer.
One way to convert from Release 12 to 13 is to use QCad. The default save format in QCad is Release 13. (An alternative way might be to specify Release 13 when you save the file from your software.)
I have imported this dxf file into QCad and then saved it to produce the attached dxf file. This imports into Inkscape with no errors.

su_v (suv-lp) wrote :

@Alvin - would it be reasonable to close the report as 'Won't Fix', or do you think it would be better to keep it open as 'Wishlist' item to implement support for older DXF versions?

Alvin Penner (apenner) wrote :

I would vote in favor of "Won't Fix".

I think I might be interested in some day providing for a more "graceful" exit in case of seeing Release 12, something better than the current crash, but I don't really see full support for release 12 as an option, since there are other programs that already support this type of conversion.

su_v (suv-lp) on 2013-02-13
summary: - Error during DXf importing
+ Error during DXf importing (DXF R12)
su_v (suv-lp) on 2013-02-13
Changed in inkscape:
status: Confirmed → Won't Fix
importance: Medium → Wishlist
Marvin R (halon) wrote :

Thanks boys, and I wish you much succes with Inkscape!

Roland Hieber (rohieb) wrote :

I have tried the workaround mentioned in comment #4, but the resulting DXF file won't open either in Inkscape, with the same error message as above. The version in the file says "AC1015" though (see attachment).

Roland Hieber (rohieb) wrote :
Alvin Penner (apenner) wrote :

a modified version of dxf_input.py has been posted to the Inkscape trunk code in rev 12344. The following changes were made:

- if an AutoCAD layer with name 0 does not exist, then it will be created. This fixes the original crash reported in comment 1.
- if an object makes a reference to a layer whose name is null, then that reference will be changed to be layer 0. This fixes the crash reported in comment 8 above.

Neither of these changes will allow the loading of Release 12 documents, but will hopefully prevent crashes caused by these documents. Two other changes were made:

- modified the tag <svg:desc> to include a complete description of the scaling used to load the document.
- put in a detector for the entity called POLYLINE, which is not supported here. This will issue a warning to the user that the document is probably incomplete and probably Release 12, and needs to be converted to Release 13 format.

To use this new version, download the files dxf_input.py, dxf_input.inx, and inkex.py from the site:
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head:/share/extensions/

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers