View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001968||FreeCAD||Feature||public||2015-02-16 15:26||2017-01-20 01:48|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Summary||0001968: importDXF (v1.38) how to change DXF export format|
|Description||I see this in the code:|
self.acadver=' 9\n$ACADVER\n 1\nAC1009\n'
"""DXF AutoCAD-Release format codes:
AC1021 2008, 2007
AC1018 2006, 2005, 2004
AC1015 2002, 2000i, 2000
How do I change this to, say, 'AC1015' so I can export a DXF file with the units of measure included in the exported file?
My export code currently looks like this:
importDXF.export(FreeCAD.ActiveDocument.Objects, "%s/%s.dxf" % (config['app']['export'], data_hash))
This is unfortunately not so simple... There are a LOT of differences between DXF formats, much more than simply changing that value. All the header format is different after AC1009.
This means basically that to support above versions, we need to recode entirely a very big part of the exporter. This cannot be done easily or quickly...
Ok. I had a suspicion this was going to be the case. Right now my clients have been able to open the resulting DXF files with LibreCAD and then just exporting them again as a DXF and they are updated to a newer version of DXF with units included.
Do you happen to have any references I can review which gives more clarity into the differences? If I can get a strong enough grasp on what has to change I may be able to extend the functionality to support a more recent version of DXF. I think that packaging the units into the export was added in R2000 (according to one of the guys I have been working with).
If I can scope out the amount of work to add support for this, it may be something I can take on. My project has been taking most of my free time, but this would be very valuable for my project.
Ah, if you are willing to work a bit on this, this would be very precious. One of the first task needed would be exactly what you are mentioning: Gathering info about what is different between versions. I'm afraid it's no simple task, I have never been able to find clear info on the subject.
The DXF libray we use for export is something we borrowed from Blender, it might also be time to recode it for good... We've also more less a plan to redo in C++ to gain better performance...
||Note, too, that you might find an intermediate solution: Have a look at how DWG export works with the Teigha converter utility. You might achieve the same result, but converting to a higher version of DXF instead of DWG...|
Ok, thanks Yorik. I can start to look into what is needed for a total rewrite of the DXF export functionality, but I probably can't take that on right now. I will start by trying to understand what the moving parts are and what would need to be done.
The Teigha converter utility may be a good option to get support in a relatively short term. I currently am not able to run Teigha on my server because I don't have X installed, but that is an easier problem to solve than rewriting all the DXF export functionality. :)
Thanks for your input.
||Forum thread: https://forum.freecadweb.org/viewtopic.php?f=10&t=20069|
|2015-02-16 15:26||swill||New Issue|
|2015-02-17 14:52||yorik||Note Added: 0005803|
|2015-02-17 15:17||swill||Note Added: 0005804|
|2015-02-17 18:12||yorik||Note Added: 0005805|
|2015-02-17 18:14||yorik||Note Added: 0005806|
|2015-02-17 18:36||swill||Note Added: 0005807|
|2017-01-20 01:48||Kunda1||Note Added: 0007892|
|2017-01-20 01:48||Kunda1||Tag Attached: DXF|