dxf splines with ezdxf (python)
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
dxf splines with ezdxf (python)
Hi,
I need to open some dxf files with freecad, what usually works except one of them which is done with 'ezdxf' python module and contains a spline.
Can please somebody help me ? (It would be fine to do with freecad but, if it is necessary, I can do it too with an other software, but which ?)
Thanks and best regards,
amka
OS: Debian GNU/Linux 8.6 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.
Build type: None
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
my python script :
import ezdxf
dwg = ezdxf.new('AC1015') # splines requires the DXF R2000 format or later
fit_points = [(0, 0, 0), (750, 500, 0), (1750, 500, 0), (2250, 1250, 0)]
msp = dwg.modelspace()
msp.add_spline(fit_points)
dwg.saveas("ezdxf_spline.dxf")
I need to open some dxf files with freecad, what usually works except one of them which is done with 'ezdxf' python module and contains a spline.
Can please somebody help me ? (It would be fine to do with freecad but, if it is necessary, I can do it too with an other software, but which ?)
Thanks and best regards,
amka
OS: Debian GNU/Linux 8.6 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.
Build type: None
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
my python script :
import ezdxf
dwg = ezdxf.new('AC1015') # splines requires the DXF R2000 format or later
fit_points = [(0, 0, 0), (750, 500, 0), (1750, 500, 0), (2250, 1250, 0)]
msp = dwg.modelspace()
msp.add_spline(fit_points)
dwg.saveas("ezdxf_spline.dxf")
- Attachments
-
- ezdxf_spline.dxf
- (16.13 KiB) Downloaded 116 times
Re: dxf splines with ezdxf (python)
Hi,
Freecad works with DXF version R12. Your DXF file is probably made with a newer version. What I did is open the DXF file in Librecad ( a good free 2d CAD program ) and saved it as an R12 file. Now the new file is imported in Freecad without problems
Freecad works with DXF version R12. Your DXF file is probably made with a newer version. What I did is open the DXF file in Librecad ( a good free 2d CAD program ) and saved it as an R12 file. Now the new file is imported in Freecad without problems
- Attachments
-
- ezdxf_spline_Willem.dxf
- (17.16 KiB) Downloaded 93 times
Re: dxf splines with ezdxf (python)
My script does a R2000 version which is newer than R12, that's true. Thanks for the information, but...
How did you please do your file ? Impossible for me to open my own dxf with libreCAD, what I already tried.
How did you please do your file ? Impossible for me to open my own dxf with libreCAD, what I already tried.
- Attachments
-
- mylibrecadversion.png (57.87 KiB) Viewed 3135 times
Re: dxf splines with ezdxf (python)
I have a newer Librecad
Version: 2.2.0-alpha
Compiler: GNU GCC 5.4.0
Compiled on: Dec 30 2016
Qt Version: 5.5.1
Boost Version: 1.58.0
System: Ubuntu 16.04.1 LTS
Version: 2.2.0-alpha
Compiler: GNU GCC 5.4.0
Compiled on: Dec 30 2016
Qt Version: 5.5.1
Boost Version: 1.58.0
System: Ubuntu 16.04.1 LTS
Re: dxf splines with ezdxf (python)
FreeCAD SAVES as R12, but opens normally any DXF file of any version (the format is incremental, so even newest versions should work). The new C++ importer still doesn't support splines, though, so you'll need to use the legacy importer (set that in the DXF preferences).
Re: dxf splines with ezdxf (python)
Hi
@ Yorik, I checked in both version 0.16 and 0.17
The original ezdxf_spline.dxf file imported in Freecad creates in the Combo view a name, but no elements. It is empty
The in Librecad opened and saved as R12 ezdxf_spline_Willem.dxf file creates name and elements.
I work with the legacy DXF-importer. I also tried to modify the file with TeighaConverter and that also failes
@ Yorik, I checked in both version 0.16 and 0.17
The original ezdxf_spline.dxf file imported in Freecad creates in the Combo view a name, but no elements. It is empty
The in Librecad opened and saved as R12 ezdxf_spline_Willem.dxf file creates name and elements.
I work with the legacy DXF-importer. I also tried to modify the file with TeighaConverter and that also failes
Re: dxf splines with ezdxf (python)
Ok there was a bug in the dxf importer, this is fixed with git commit 5d2e834bc3
Re: dxf splines with ezdxf (python)
Yorik, thank for fixing the bug before it is posted as a bug . I am now busy redecorating my kitchen but I will try this fix asap
Re: dxf splines with ezdxf (python)
Hi,
Thanks for replies and... I see 'src' on the path for the fix... Have I then please to compile FreeCad if I want to open my dxf ?
amka
Thanks for replies and... I see 'src' on the path for the fix... Have I then please to compile FreeCad if I want to open my dxf ?
amka
Re: dxf splines with ezdxf (python)
Yes, or, wait for someone to compile for you