Cannot save to dxf, script error occured

Bug #957086 reported by Yann Papouin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Alvin Penner

Bug Description

I've attached the svg file that need to be saved as dxf.

This is the output:

Traceback (most recent call last):
  File "dxf_outlines.py", line 299, in <module>
    e.affect()
  File "C:\inkscape\inkscape\share\extensions\inkex.py", line 230, in affect
    self.effect()
  File "dxf_outlines.py", line 290, in effect
    self.process_group(doc)
  File "dxf_outlines.py", line 259, in process_group
    self.process_group(node)
  File "dxf_outlines.py", line 259, in process_group
    self.process_group(node)
  File "dxf_outlines.py", line 261, in process_group
    self.process_clone(node)
  File "dxf_outlines.py", line 238, in process_clone
    if refnode.tag == inkex.addNS('g','svg'):
AttributeError: 'NoneType' object has no attribute 'tag'

From the attached file:
   inkscape:version="0.48+devel r11093"

Revision history for this message
Yann Papouin (yann-papouin) wrote :
su_v (suv-lp)
description: updated
tags: added: dxf exporting
su_v (suv-lp)
tags: added: clones
Revision history for this message
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48+devel r11093 on OS X Lion:

AFAICT the python script fails to handle orphaned clones: it crashes instead of ignoring them (simple test case attached).

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

A "regular" clone exports ok for me.

Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Attaching "fixed" version of the original sample file which exports to DXF without python failure (all orphaned clones deleted, some of the inside otherwise empty groups).

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

thanks for testing, attached is a slightly modified version of dxf_outlines.py. This will silently ignore the orphaned clones.

Revision history for this message
Yann Papouin (yann-papouin) wrote :

Thanks both of you for this quick fix, it saves my week :)

I also need to save only one layer, so I made a proposal based on your work:
https://bugs.launchpad.net/inkscape/+bug/959159

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

good to hear, committed to bzr rev 11100

Changed in inkscape:
status: Confirmed → Fix Committed
su_v (suv-lp)
Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
milestone: none → 0.49
tags: added: backport-proposed
Revision history for this message
su_v (suv-lp) wrote :

Backported to branch 0.48.x in revision 9935.

tags: removed: backport-proposed
Changed in inkscape:
milestone: 0.49 → 0.48.4
Ted Gould (ted)
Changed in inkscape:
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.