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!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: DXF Export Features

Post by sgrogan »

rawrpenguinzombies wrote: Wed Sep 12, 2018 12:28 am 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.
My experience is when the commercial programs license their proprietary formats that are "dumb" i.e. no history. It would be tough to translate anyway. Some programs have a "Feature Recognition" feature that attempts to rebuild the model para-metrically. The versions I have used aren't very good and loose "Design intent".

If there ever was an OpenSource format that preserved history (and OpenSource is the only way it would ever happen), the commercial companies would start hiring a lot of lawyers.
"fight the good fight"
User avatar
wandererfan
Veteran
Posts: 6320
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: DXF Export Features

Post by wandererfan »

rawrpenguinzombies wrote: Wed Sep 12, 2018 12:28 am 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.
I think one of these files uses inches and one uses mm as unit setting. Can anybody confirm?

The drawings themselves are identical and in FC default units (mm).
Attachments
unitsTestmm.dxf
(9.48 KiB) Downloaded 28 times
unitsTestin.dxf
(9.48 KiB) Downloaded 41 times
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: DXF Export Features

Post by saso »

I confirm. LibreCAD, DraftSight, AutoCAD,... all allow to set the units. Having support for this in FreeCAD for both import and export would be nice :)

https://www.autodesk.com/techpubs/autoc ... dxf_02.htm
$INSUNITS

70

Default drawing units:
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
Last edited by saso on Wed Sep 12, 2018 4:52 pm, edited 1 time in total.
rawrpenguinzombies
Posts: 9
Joined: Mon Sep 10, 2018 7:50 pm

Re: DXF Export Features

Post by rawrpenguinzombies »

I am not sure what you are asking me to test with those sample DXFs? You want me to just open them and see if they are dimensioned in inches or mm? What geometry is in there? And what are the true dimensions so I can report back whether or not it imports correctly?

Where do we go from here? Do I post the request for this feature to the Jobs board if I am willing to sponsor it? Or can we assemble a team here to get this done? I really want to see this as a feature because it would just make it so much more expedient for me.
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: DXF Export Features

Post by keithsloan52 »

rawrpenguinzombies wrote: Wed Sep 12, 2018 4:49 pm
Where do we go from here? Do I post the request for this feature to the Jobs board if I am willing to sponsor it? Or can we assemble a team here to get this done? I really want to see this as a feature because it would just make it so much more expedient for me.
The tracker is for feature requests as well as bugs see https://www.freecadweb.org/wiki/Tracker
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: DXF Export Features

Post by saso »

Setting units to dxf/dwg files does not change (scale) the geometry. For example when you draw and make a line 10 units long, it is stored just like that (unitless). When you set the units it just tells what is the general unit for the drawing (you can have in one file different drawings scaled in to different units, 2d cad does not really care about that).

The difference when setting the units comes in to play only when you import / export the file. For example you draw and save it as inches, but in another program you have set cm by default, then the import process can automatically scale the imported drawing to the correct size.
User avatar
wandererfan
Veteran
Posts: 6320
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: DXF Export Features

Post by wandererfan »

rawrpenguinzombies wrote: Wed Sep 12, 2018 4:49 pm I am not sure what you are asking me to test with those sample DXFs? You want me to just open them and see if they are dimensioned in inches or mm?
That's all I want for now. If I have that part right, I can make a change so files will be marked metric/mm (since that is what is inside FC).

Then we can try to figure out how to output actual inch measurements.
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: DXF Export Features

Post by saso »

wandererfan wrote: Wed Sep 12, 2018 7:46 pm Then we can try to figure out how to output actual inch measurements.
Maybe putting everything that will get exported in to a new block (compound?) and scale and export that object? Similar could be for import, check the set units of the imported dxf, import everything as one object (temporary?) and scale it to fit the default mm (if it would be temporary then one would have to do a downgrade at the end).
rawrpenguinzombies
Posts: 9
Joined: Mon Sep 10, 2018 7:50 pm

Re: DXF Export Features

Post by rawrpenguinzombies »

saso wrote: Wed Sep 12, 2018 8:24 pm
wandererfan wrote: Wed Sep 12, 2018 7:46 pm Then we can try to figure out how to output actual inch measurements.
Maybe putting everything that will get exported in to a new block (compound?) and scale and export that object? Similar could be for import, check the set units of the imported dxf, import everything as one object (temporary?) and scale it to fit the default mm (if it would be temporary then one would have to do a downgrade at the end).
So this is basically what I have been doing right now to get by, but because here in the US certain customers and suppliers work in metric and others only work in inches it becomes cumbersome to be changing the scale of the unitless file everytime it needs to go to a different party. Thats why I think setting the units in the file would be so advantageous and toggling between the two on export would allow me to maintain both copies when necessary without extra labor.
wandererfan wrote: Wed Sep 12, 2018 7:46 pm
rawrpenguinzombies wrote: Wed Sep 12, 2018 4:49 pm I am not sure what you are asking me to test with those sample DXFs? You want me to just open them and see if they are dimensioned in inches or mm?
That's all I want for now. If I have that part right, I can make a change so files will be marked metric/mm (since that is what is inside FC).

Then we can try to figure out how to output actual inch measurements.
So I brought it into my production viewer software and it doesn't change the units of my analysis toolbar regardless of which one I open so maybe if you gave me something with the same geometry in both mm and in I could tell you if the tool I am importing it into is actually recognizing the units flag properly.
keithsloan52 wrote: Wed Sep 12, 2018 4:58 pm
rawrpenguinzombies wrote: Wed Sep 12, 2018 4:49 pm
Where do we go from here? Do I post the request for this feature to the Jobs board if I am willing to sponsor it? Or can we assemble a team here to get this done? I really want to see this as a feature because it would just make it so much more expedient for me.
The tracker is for feature requests as well as bugs see https://www.freecadweb.org/wiki/Tracker
Thank you I will look into this today.
rawrpenguinzombies
Posts: 9
Joined: Mon Sep 10, 2018 7:50 pm

Re: DXF Export Features

Post by rawrpenguinzombies »

Okay all, I have a ticket going on the tracker. You can check it out at https://www.freecadweb.org/tracker/view.php?id=3594 please let me know if I need to revise it on there as this is my first tracker posting and I am not sure I have all my bases covered.
Post Reply