bug? FreeCAD ignoring DXF import preferences

Hi Yorik
In current master I have noticed that FreeCAD is ignoring various DXF import preference values when using your newer C++ DXF importer. Is there any chance this a bug or possibly just a not yet implemented aspect of your recent DXF work?

Here is a dxf file I created in LibreCAD with a selection of elements, in case it is convenient.
dxfwithmanyexampleelementscreatedwithLibrecad.dxf (8.85 KB)
If I start FreeCAD the go to Draft WB, Edit menu…Preferences…Import-Export…DXF

with “legacy Python importer” NOT selected, the following make not difference, in all cases I just get simple Part objects named/labelled “Shape” etc.

  1. simple Part shapes/Draft Objects/Sketches - setting here makes no difference
  2. join geometry tick box - setting here makes no difference
  3. Treat ellipses and splines as polylines - setting here makes no difference

If I tick use “legacy Python importer” then the settings work.

By the way, with importing the above test dxf file with the new importer I get the Ellipse but the spline is ignored where as with the legacy Python importer the spline is imported (this is with “treat ellipses and splines as polylines” not ticked) but the ellipse causes an error message

Draft workbench activated
opening /home/user/Downloads/dxfwithmanyexampleelementscreatedwithLibrecad.dxf…
drawing 8 lines…
drawing 1 polylines…
drawing 1 arcs…
drawing 1 circles…
drawing 1 splines…
drawing 1 ellipses…
Traceback (most recent call last):
File “”, line 1, in
File “/home/user/Downloads/cad/freecad_master/build_master_blobfishOCE691_tbb_gl2ps_freeimg/Mod/Draft/importDXF.py”, line 1503, in open
processdxf(doc,filename)
File “/home/user/Downloads/cad/freecad_master/build_master_blobfishOCE691_tbb_gl2ps_freeimg/Mod/Draft/importDXF.py”, line 1221, in processdxf
shape = drawEllipse(ellipse)
File “/home/user/Downloads/cad/freecad_master/build_master_blobfishOCE691_tbb_gl2ps_freeimg/Mod/Draft/importDXF.py”, line 510, in drawEllipse
if (dxfCreateDraft or dxfCreateSketch) and (not forceShape):
<type ‘exceptions.NameError’>: global name ‘forceShape’ is not defined



Let me know if you would like me to write up a ticket. :slight_smile:

Jim

OS: Ubuntu 12.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6350 (Git)
Build type: Debug
Branch: master
Hash: 645a83ad324fdf06272cccdf852144da6b2626a2
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
OCC version: 6.9.1.oce-0.18-dev

Hi Jim,
This is normal… Indeed only a few of the options have been implemented so far. But I’m not even sure if all will be, some might not be necessary anymore. Maybe we should separate them on the preferences page (or at least add a note)…

The forceShape error I’ll fix ASAP. EDIT fixed in fe959b8

Yeah, good idea to make it more clear in one way or another, if they appropriate to implemented for the new importer then perhaps we could just group them as “legacy importer options” in one way or another.

By the way I noticed what I think is a new bug that must have been recently introduced, Draft Shape String is not working here for me. I get the creation taskview, you enter the some values, then you get to the text entry box enter the text …but then an “enter” key press or two should bring up just the next parameter which from memory is text height in mm, which still comes up but I get two entry boxes now, the second one is text entry again…I suspect this is something to do with your recent Draft updates …let me know if you don’t see the problem and I will write it all up properly …but if you are seeing the same bug, I think you will quickly see what I mean?

hm yeah.. there is a pyside bug there again…
EDIT oh no, it’s the new OK button :imp: