DXF export problem

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
Post Reply
Paul Frederick
Posts: 3
Joined: Wed Apr 10, 2019 7:54 pm

DXF export problem

Post by Paul Frederick »

When I export a DXF file in freecad the units are wrong when I open it up in LibreCAD. Both programs are set to US Customary units. LibreCAD seems to be getting metric units from the DXF file that freecad writes though? Because it sure looks like millimeters to me. I made a square an inch on a side in freecad, exported it as a DXF file and opened it in LibreCAD. Now Librecad says the sides are 25.4 inches. So there's a bit of a conversion foul up going on. Any constructive help in this matter would be greatly appreciated.

I am running
FreeCAD 0.19, Libs: 0.19R16408 (Git)

Thank you.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: DXF export problem

Post by openBrain »

That's an actual problem with DXF which is AFAIK unitless.
I guess the problem is that :
* FC always export as mm
* LibreCAD import in the current selected unit

Just open you DXF with LibreCAD set in mm then change the unit. ;)
User avatar
wandererfan
Veteran
Posts: 6324
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: DXF export problem

Post by wandererfan »

Paul Frederick wrote: Wed Apr 10, 2019 8:35 pm When I export a DXF file in freecad the units are wrong when I open it up in LibreCAD. Both programs are set to US Customary units. LibreCAD seems to be getting metric units from the DXF file that freecad writes though? Because it sure looks like millimeters to me.
The versions of the Dxf spec that FreeCAD exporters support are unit-less. FreeCAD exports in internal units (millimeters). The importing application is supposed to be able to read mm, but use inches.

https://forum.freecadweb.org/viewtopic. ... 07#p277060
https://www.forum.freecadweb.org/viewto ... xf#p277912
Paul Frederick
Posts: 3
Joined: Wed Apr 10, 2019 7:54 pm

Re: DXF export problem

Post by Paul Frederick »

openBrain wrote: Thu Apr 11, 2019 1:50 pm That's an actual problem with DXF which is AFAIK unitless.
I guess the problem is that :
* FC always export as mm
* LibreCAD import in the current selected unit

Just open you DXF with LibreCAD set in mm then change the unit. ;)
Thanks for the help. I tried that and it does not work here. Would have been nice if it did. Seems to be a shortcoming in LibreCAD to me. Not to say that FreeCAD doesn't have its shortcoming too. Because if FreeCAD just exported in the correct units I wouldn't have this problem. I could say that FreeCAD is in effect generating a corrupt file. I use other software that all seems to manage to get this right. Oh well my problem I guess. I think I have a solution for it too.
User avatar
Roy_043
Veteran
Posts: 8577
Joined: Thu Dec 27, 2018 12:28 pm

Re: DXF export problem

Post by Roy_043 »

openBrain wrote: Thu Apr 11, 2019 1:50 pm DXF which is AFAIK unitless
In a professional dwg/dxf you would expect the INSUNITS setting to match the drawing units.
Having a mismatch would be strange and lead to scaling problems when the dxf/dwg is inserted in a different file, or when another file is inserted in the dxf/dwg itself.

Example:
You have a dwg of a hangar where 1DU=1m, but your INSUNITS setting is 4 (=mm).
You insert the file in a different dwg where INSUNITS is 6 (=m).
The result is that the block is automatically scaled down (factor 1/1000) and your hangar looks like a matchbox.

For dealing with older dwg/dxf files (< version 2000) that do not have this setting there are two variables (at least in AutoCAD and BricsCAD):
INSUNITSDEFSOURCE
INSUNITSDEFTARGET
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: DXF export problem

Post by NormandC »

wandererfan wrote: Thu Apr 11, 2019 2:06 pm FreeCAD exports in internal units (millimeters).
You can set a scale factor for DXF import. Wouldn't it be possible to have a similar option for export?
User avatar
Roy_043
Veteran
Posts: 8577
Joined: Thu Dec 27, 2018 12:28 pm

Re: DXF export problem

Post by Roy_043 »

Just had a look at LibreCAD. It features a Scale command and you can even specify the scale as 1/25.4. Seems like a very easy workaround.
Post Reply