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.
DXF export problem
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!
-
- Posts: 3
- Joined: Wed Apr 10, 2019 7:54 pm
Re: DXF export problem
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.
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.
- wandererfan
- Veteran
- Posts: 6324
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: DXF export problem
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.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.
https://forum.freecadweb.org/viewtopic. ... 07#p277060
https://www.forum.freecadweb.org/viewto ... xf#p277912
-
- Posts: 3
- Joined: Wed Apr 10, 2019 7:54 pm
Re: DXF export problem
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.
Re: DXF export problem
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
Re: DXF export problem
You can set a scale factor for DXF import. Wouldn't it be possible to have a similar option for export?
Re: DXF export problem
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.