impossible to open / import DXF in linux

Bug #366227 reported by Chris
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

Hi' I've just installed the latest Ubuntu 9.04 final on my computer. I've juste compiled the latest Inkscape 0.46+devel r21213.

I just tried to import a DXF file and had 2 issues. In a first time there was a problem that I tried to fix with this command line :

sudo make install |grep dxf

here's what I got : (I'm french)

 /usr/bin/install -c 'dxf_input.py' '/usr/local/share/inkscape/extensions/dxf_input.py'
 /usr/bin/install -c 'dxf_outlines.py' '/usr/local/share/inkscape/extensions/dxf_outlines.py'
 /usr/bin/install -c 'dxf_templates.py' '/usr/local/share/inkscape/extensions/dxf_templates.py'
 /usr/bin/install -c 'ps2dxf.sh' '/usr/local/share/inkscape/extensions/ps2dxf.sh'
 /usr/bin/install -c -m 644 'dxf_input.inx' '/usr/local/share/inkscape/extensions/dxf_input.inx'
 /usr/bin/install -c -m 644 'dxf_outlines.inx' '/usr/local/share/inkscape/extensions/dxf_outlines.inx'
 /usr/bin/install -c -m 644 'dxf_output.inx' '/usr/local/share/inkscape/extensions/dxf_output.inx'
dz.po: AVERTISSEMENT : Il manque le jeu de caractères dans l'en-tête.
                       La conversion vers le jeu de caractères de l'utilisateur ne fonctionnera pas.
zh_TW.po: AVERTISSEMENT : Il manque le jeu de caractères dans l'en-tête.
                          La conversion vers le jeu de caractères de l'utilisateur ne fonctionnera pas.
/usr/bin/install: ne peut évaluer `./dz.gmo': Aucun fichier ou dossier de ce type
/usr/bin/install: ne peut évaluer `./zh_TW.gmo': Aucun fichier ou dossier de ce type

And lastly here's the error reported by Inkscape :

Traceback (most recent call last):
  File "/usr/local/share/inkscape/extensions/dxf_input.py", line 348, in <module>
    desc.text = '%s - scale = %f' % (args[0], scale)
  File "lxml.etree.pyx", line 833, in lxml.etree._Element.text.__set__ (src/lxml/lxml.etree.c:10968)
  File "apihelpers.pxi", line 581, in lxml.etree._setNodeText (src/lxml/lxml.etree.c:32878)
  File "apihelpers.pxi", line 1136, in lxml.etree._utf8 (src/lxml/lxml.etree.c:36998)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes

I hope this is not an already bug reported I've not found any thing on this

Greatings,

Chris

Tags: dxf importing
Revision history for this message
Alvin Penner (apenner) wrote :

could you attach the .dxf file you are trying to import?

Revision history for this message
Alvin Penner (apenner) wrote :

  Attached is a modified version of the file dxf_input.py which should fix the problem. Could you tell me if this works?
  This has been committed to rev 21227

Changed in inkscape:
status: New → Fix Committed
Revision history for this message
Chris (ikki-phoenix) wrote : RE: [Bug 366227] Re: impossible to open / import DXF in linux
Download full text (4.0 KiB)

Hi' I replaced the dxf_input.py by the one in the link you sent. I tried again to open the same file that caused the same error BUT the file was stored on an USB key so I copied it on the desktop to ensure that the bug couldn't come from the "location" or "device" and surprisingly inkscape was able to open it. As I launched Inkscape from a terminal here's what it "says" :

** (inkscape:7017): WARNING **: Malformed URI

I can't say now that I replaced the dxf_input.py file if it is because of the new one that it work or if the trick is that it doesn't want to load from a USB key...

I'll send you the dfx file I was trying to work with. Perhaps it should help to determine the problem.

Thx for being so reactive and for this great program !!!

Chris

> Date: Fri, 24 Apr 2009 22:07:11 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 366227] Re: impossible to open / import DXF in linux
>
> Attached is a modified version of the file dxf_input.py which should fix the problem. Could you tell me if this works?
> This has been committed to rev 21227
>
>
> ** Attachment added: "C:\Program Files\Inkscape\share\extensions\dxf_input.py"
> http://launchpadlibrarian.net/25942839/C%3A%5CProgram%20Files%5CInkscape%5Cshare%5Cextensions%5Cdxf_input.py
>
> ** Changed in: inkscape
> Status: New => Fix Committed
>
> --
> impossible to open / import DXF in linux
> https://bugs.launchpad.net/bugs/366227
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Inkscape: A Vector Drawing Tool: Fix Committed
>
> Bug description:
> Hi' I've just installed the latest Ubuntu 9.04 final on my computer. I've juste compiled the latest Inkscape 0.46+devel r21213.
>
> I just tried to import a DXF file and had 2 issues. In a first time there was a problem that I tried to fix with this command line :
>
> sudo make install |grep dxf
>
> here's what I got : (I'm french)
>
> /usr/bin/install -c 'dxf_input.py' '/usr/local/share/inkscape/extensions/dxf_input.py'
> /usr/bin/install -c 'dxf_outlines.py' '/usr/local/share/inkscape/extensions/dxf_outlines.py'
> /usr/bin/install -c 'dxf_templates.py' '/usr/local/share/inkscape/extensions/dxf_templates.py'
> /usr/bin/install -c 'ps2dxf.sh' '/usr/local/share/inkscape/extensions/ps2dxf.sh'
> /usr/bin/install -c -m 644 'dxf_input.inx' '/usr/local/share/inkscape/extensions/dxf_input.inx'
> /usr/bin/install -c -m 644 'dxf_outlines.inx' '/usr/local/share/inkscape/extensions/dxf_outlines.inx'
> /usr/bin/install -c -m 644 'dxf_output.inx' '/usr/local/share/inkscape/extensions/dxf_output.inx'
> dz.po: AVERTISSEMENT : Il manque le jeu de caractères dans l'en-tête.
> La conversion vers le jeu de caractères de l'utilisateur ne fonctionnera pas.
> zh_TW.po: AVERTISSEMENT : Il manque le jeu de caractères dans l'en-tête.
> La conversion vers le jeu de caractères de l'utilisateur ne fonctionnera pas.
> /usr/bin/install: ne peut évaluer `./dz.gmo': Aucun fichier ou dossier de ce type
> /usr/bin/install: ne peut évaluer `./zh_TW.gmo': Aucun fichier ou dossier de ce type
>
> And lastly here's the error ...

Read more...

Revision history for this message
Alvin Penner (apenner) wrote :

- there are three separate issues that have shown up here:
- the original problem was that there were non-Ascii characters in the filename, either the name itself, or perhaps the directory name. Perhaps the USB drive had a folder name with characters such as è or é in it. This has been fixed (I believe) in the patch I submitted yesterday.
- the second problem was the messages about Malformed URI. I got these messages as well, but ignored them since they are not generated by the script that is importing .dxf, this is a separate issue from .dxf.
- the third issue is the presence of Blocks in the .dxf file. The support for Blocks is somewhat limited in the Python script. I loaded the original .dxf file into Inkscape but the quality of the rendering was poor. So I loaded the .dxf file into QCad and used the menu procedure Block | Explode. I then re-loaded the new .dxf file into Inkscape and got a better result, attached below.

    If the procedure to explode Blocks is available in your CAD program, then I would recommend using it before you try to import the dxf file into Inkscape. This may mean exporting a separate output .dxf file just for Inkscape.

Revision history for this message
Alvin Penner (apenner) wrote :
su_v (suv-lp)
tags: added: dxf importing
Revision history for this message
su_v (suv-lp) wrote :

Alvin Penner wrote on 2009-04-25:
> This has been committed to rev 21227

bzr r7695 and r7771 -> setting status to 'Fix Released' (milestone 0.47).

Changed in inkscape:
milestone: none → 0.47
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.