Error (index out of range) when saving SVG as DXF

Asked by Matthew Zhu

This is a near-duplicate of the expired question here:
https://answers.launchpad.net/inkscape/+question/631890

========

What I was trying to do: I imported an SVG and tried to save it as a DXF.

========

Expected behavior: Save without error

Actual behavior: Dialog box pops up with an error that approximately looks like:

Traceback (most recent call last):
  File "dxf_outlines.py", line 360, in <module>
    e.affect()
  File "/usr/share/inkscape/inkex.py", line 283, in affect
    self.effect()
  File "dxf_outlines.py", line 344, in effect
    h = self.unittouu(self.document.getroot().xpath('@height', namespaces=inkex.NSS)[0])
IndexError: list index out of range

and then a dialog saying that the save failed.

=========

Tech details: running Inkscape 0.92.2 on Linux Ubuntu 18.04

=========

Fix: The fix detailed in the linked question worked for me. As suggested by marenhachmann, replacing the offending line with:

h = self.unittouu(self.getDocumentHeight())

produces the expected behavior.

Question information

Language:
English Edit question
Status:
Expired
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Hachmann (marenhachmann) said :
#1

Great :)

Revision history for this message
Hachmann (marenhachmann) said :
#2

Btw. which version of Inkscape are you using?

Revision history for this message
Matthew Zhu (mz496) said :
#3

I'm using Inkscape 0.92.2 for Linux.

Revision history for this message
Hachmann (marenhachmann) said :
#4

Thanks for the reminder, Matthew. I've opened a merge request with the suggested fix:
https://gitlab.com/inkscape/inkscape/merge_requests/138

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.