Ticket #3594: DXF Export Units Toggle (Was: DXF Export Features)

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!
rawrpenguinzombies
Posts: 9
Joined: Mon Sep 10, 2018 7:50 pm

Ticket #3594: DXF Export Units Toggle (Was: DXF Export Features)

Post by rawrpenguinzombies »

I want to just say up front that I have now been using FreeCAD since a little before May of '17 and am only just now having an issue worthy of discussion here I believe.

So, I am using FreeCAD in a commercial environment primarily developing step files for up to 5 axis CNC machining, but more recently I have needed to create DXF files for water jet and laser cutting. This was not a problem until today when I was notified that the material stock was not large enough for the DXF file. Long story short the software they imported the DXF into was in inches (as my general settings are also... welcome to the state of industry in the USA), but the FreeCAD DXF file seems to be unitless as discuss elsewhere in the FreeCAD web forums.

There are of course work around solutions to this issue. I have started to simply create scaled clones of the part that are used for the export operation. This is not an ideal solution though.

I am hoping that someone here can set me straight on what my options are for fixing my DXF files to reflect inches as the units or perhaps there is a fix for this that the usual googling has failed to reveal. I also would be open to I guess "sponsor" someone to make a commit to FreeCAD that would simply let users toggle the units of the DXF file in the export options menu. Please, let us discuss.
Last edited by Kunda1 on Sat Jan 22, 2022 11:58 pm, edited 1 time in total.
Reason: Added ticket number to thread title
chrisb
Veteran
Posts: 54168
Joined: Tue Mar 17, 2015 9:14 am

Re: DXF Export Features

Post by chrisb »

Moved to help forum
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: DXF Export Features

Post by wandererfan »

rawrpenguinzombies wrote: Mon Sep 10, 2018 7:58 pm I am hoping that someone here can set me straight on what my options are for fixing my DXF files to reflect inches as the units or perhaps there is a fix for this that the usual googling has failed to reveal. I also would be open to I guess "sponsor" someone to make a commit to FreeCAD that would simply let users toggle the units of the DXF file in the export options menu. Please, let us discuss.
1) do you know what version of DXF started to support units? We only export R12 and R14 at the moment.
2) any DXF gurus out there that know how to specify units in a DXF file?
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: DXF Export Features

Post by easyw-fc »

wandererfan wrote: Tue Sep 11, 2018 1:16 pm
rawrpenguinzombies wrote: Mon Sep 10, 2018 7:58 pm I am hoping that someone here can set me straight on what my options are for fixing my DXF files to reflect inches as the units or perhaps there is a fix for this that the usual googling has failed to reveal. I also would be open to I guess "sponsor" someone to make a commit to FreeCAD that would simply let users toggle the units of the DXF file in the export options menu. Please, let us discuss.
1) do you know what version of DXF started to support units? We only export R12 and R14 at the moment.
2) any DXF gurus out there that know how to specify units in a DXF file?
it seems only R14 has support for units...
https://www.autodesk.com/techpubs/autoc ... dxf_02.htm
$INSUNITS 70
Default drawing units for AutoCAD DesignCenter blocks:
0 = Unitless; 1 = Inches; 2 = Feet; 3 = Miles; 4 = Millimeters;
5 = Centimeters; 6 = Meters; 7 = Kilometers; 8 = Microinches;
9 = Mils; 10 = Yards; 11 = Angstroms; 12 = Nanometers;
13 = Microns; 14 = Decimeters; 15 = Decameters;
16 = Hectometers; 17 = Gigameters; 18 = Astronomical units;
19 = Light years; 20 = Parsecs
$MEASUREMENT
70
Sets drawing units: 0 = English; 1 = Metric
$DIMLUNIT
70
Sets units for all dimension types except Angular:
1 = Scientific; 2 = Decimal; 3 = Engineering
4 = Architectural; 5 = Fractional; 6 = Windows desktop
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: DXF Export Features

Post by keithsloan52 »

wandererfan wrote: Tue Sep 11, 2018 1:16 pm
rawrpenguinzombies wrote: Mon Sep 10, 2018 7:58 pm I am hoping that someone here can set me straight on what my options are for fixing my DXF files to reflect inches as the units or perhaps there is a fix for this that the usual googling has failed to reveal. I also would be open to I guess "sponsor" someone to make a commit to FreeCAD that would simply let users toggle the units of the DXF file in the export options menu. Please, let us discuss.
1) do you know what version of DXF started to support units? We only export R12 and R14 at the moment.
2) any DXF gurus out there that know how to specify units in a DXF file?
Not sure what version of DXF units applies but I found this info on the web.
You can open the DXF in notepad (or another text editor) & look for the $INSUNITS value.
For mm:
$INSUNITS
70
4

For inches:
$INSUNITS
70
1
rawrpenguinzombies
Posts: 9
Joined: Mon Sep 10, 2018 7:50 pm

Re: DXF Export Features

Post by rawrpenguinzombies »

Alright, I will give this notepad solution a try. Is anyone interested in adding this as a feature of dxf export?

And while I am here now and have this thread going on adding features to the dxf export menu, is there any active development on supporting additional proprietary file types say catia files or solidworks files? I love using FreeCAD for work and I want to give back to the community especially if it means more features and functionality. Honestly it is probably one the reasons I got the job I have is because I promised I could increase the modelling throughput without the initial overhead of another license. I have no way of dealing with the work of my colleagues without using a lower level format such as step, iges, stl etc. Although since I have been here they have been adding FreeCAD to a few other computers at a time so perhaps the end solution will be to just push Catia out entirely. 8-) :twisted:
TheMarkster
Veteran
Posts: 5512
Joined: Thu Apr 05, 2018 1:53 am

Re: DXF Export Features

Post by TheMarkster »

A couple examples (in BASIC) of creating and reading this format:

https://www.autodesk.com/techpubs/autoc ... _u05_b.htm

pdf dxf reference:

http://images.autodesk.com/adsk/files/a ... ce_enu.pdf
chrisb
Veteran
Posts: 54168
Joined: Tue Mar 17, 2015 9:14 am

Re: DXF Export Features

Post by chrisb »

rawrpenguinzombies wrote: Tue Sep 11, 2018 6:35 pm Alright, I will give this notepad solution a try. Is anyone interested in adding this as a feature of dxf export?
Let's first hear if it works.
And while I am here now and have this thread going on adding features to the dxf export menu, is there any active development on supporting additional proprietary file types say catia files or solidworks files?
This has, of course, been discussed before. These formats are not documented to the public, and therefore we have to use e.g. Step, which seems to be among, if not the, most advanced standard formats.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: DXF Export Features

Post by sgrogan »

rawrpenguinzombies wrote: Tue Sep 11, 2018 6:35 pm I have no way of dealing with the work of my colleagues without using a lower level format such as step, iges, stl etc. Although since I have been here they have been adding FreeCAD to a few other computers at a time so perhaps the end solution will be to just push Catia out entirely. 8-) :twisted:
I use FreeCAD very much like you https://forum.freecadweb.org/viewtopic.php?f=8&t=30542
Even if FreeCAD did support other proprietary formats, they would still be "dumb" after import. FreeCAD's step support is very good. There is ongoing development to handle complicated assembly hierarchy and large models.

That said there is also work on other formats
https://forum.freecadweb.org/viewtopic.php?f=22&t=20575
https://forum.freecadweb.org/viewtopic.php?f=8&t=30601
"fight the good fight"
rawrpenguinzombies
Posts: 9
Joined: Mon Sep 10, 2018 7:50 pm

Re: DXF Export Features

Post by rawrpenguinzombies »

No, a quick search of the file doesn't yield $INSUNITS and in a quick attempt to make it work I tried pasting the information in a number of different places, but it seems to break the file if placed in certain blocks and do nothing all together if placed another. The absence of the variable makes me think I am not exporting to an R14 template even though a previous post says that is support and indeed a read of the source shows that such a template does exist. I am just not sure how to actively make use of it hence the desire for the option.

And please don't misinterpret me, I do not mean that step files are inferior. Step files are an industry standard with great cross platform compatibility. When I mean lower level, I am making reference to the modeling information and history. Step files are just the raw data of the shape without all of the how we got to it included. Because I have access to Catia I just thought perhaps I could furnish someone with files of basic shapes and perhaps we could reverse engineer them? But perhaps not.
Post Reply