Closed ceremcem closed 3 years ago
This DXF import looks quite old. According to its readme, it is not need unless you explicitly want to use the legacy importer. Any reason for doing that? I tried the built-in importer. Seems working fine.
What is "built-in importer"? First I tried "File->Import", now I tried "File->Open", both are giving the same exception. Then I uninstalled dxf-library
and restarted FreeCAD and "File->Open" the dxf file, here is the exception:
06:40:41 Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/aea/fc-build/Release/Mod/Draft/importDXF.py", line 2780, in open
processdxf(doc, filename)
File "/home/aea/fc-build/Release/Mod/Draft/importDXF.py", line 2191, in processdxf
drawing = dxfReader.readDXF(filename)
File "/home/aea/.FreeCAD/Macro/dxfReader.py", line 372, in readDXF
drawing = sm.run(infile)
File "/home/aea/.FreeCAD/Macro/dxfReader.py", line 95, in run
(newState, cargo) = handler(cargo)
File "/home/aea/.FreeCAD/Macro/dxfReader.py", line 299, in start_section
obj = handleBlock(obj, infile) # we need to find all there contents
File "/home/aea/.FreeCAD/Macro/dxfReader.py", line 239, in handleBlock
obj = handleObject(infile)
File "/home/aea/.FreeCAD/Macro/dxfReader.py", line 196, in handleObject
line = infile.readline()
File "/usr/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
<class 'UnicodeDecodeError'>: 'utf-8' codec can't decode byte 0xdd in position 7362: invalid continuation byte
How should I import that file?
Opening that DXF with LibreCAD and saving as "DXF 2007" format works fine after uninstalling dxf-library
.
Uncheck the legacy options in the preference.
Okay, when I uncheck that checkbox, FreeCAD imports/opens the original DXF file.
However:
07:01:20 Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/aea/fc-build/Release/Mod/Draft/importDXF.py", line 2795, in open
Import.readDXF(filename)
<class 'RuntimeError'>: gp_Trsf::SetValues, null determinant
Just pushed a fix in both of my branches. You can sync and try.
Works as expected. Thanks.
Description
Import
ing a specific DXF gives the following exception:Is there anyone having a workaround for this?
Attachments
Contents of the DXF file:
DXF File: RT-507_dxf.zip
Version