Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Options

DXF file export in wrong units

philip_boddingtonphilip_boddington Member Posts: 1 ✭✭
I always model in metric mm's. Over the last 5 years I have successfully exported dxf files for laser cutting which have been cut to the correct dimensions. 

However I am now trying to send cutting drawings in dxf format to a different cutter and their software is telling me that my dxf files dimensions are incorrect. If my model has a dimension of 25.4 mm their software is reading this via my dxf file as 1 - ie the dimension is still correct but in the dxf file it has been converted to inches.

I read the ascii text in the dxf file and indeed the units are stated by onshape to be in inches which is incorrect.

Has something changed with how Onshape exports dxf files recently?

Am I write in thinking that  Onshape is converting my model dimensions from mm to inches when I export to dxf despite my drawings being in mm?

I saw the post about a workaround involving changing my model dimensions to inches and then saving to dxf. I don't see how this helps as my dxf file will still be in inches.

I would appreciate any help with this. Thanks.

Answers

  • Options
    Hans_Leirvik_1Hans_Leirvik_1 Member Posts: 38 ✭✭
    I made simple metric part using inch dimensions in the sketch.
    The exported dxf file is in the document, you can look at it to see wheter it is different compared to your files....

    https://cad.onshape.com/documents/bcecbaabf7c1467ae8ee16d3/w/b4fc9e17f8e71eecf15143eb/e/24f3592a28c86d3ca5c1e354


  • Options
    rhys_skinnerrhys_skinner Member Posts: 8 PRO
    Dimensions in dxf file are unitless themselves, they will export as your workspace shows them.

    Problem is Onshape will not care to correct the unit information in the header of the exported file. YES there is units specified in a .dxf file - this is to instruct the importing application.

    This is to be considered a bug IMO


    I have also had several issues of suppliers using the incorrect units because onshape does not change the units, regardless the header is always specifying inches unless you edit the file manually in notepad.

    Not all suppliers are cluey enough to check with units and not all software make apparent selecting the units to interpret as.
    Automated quoting software even worse and worse again these are often run by not very knowledgeable staff.


    Tell your supplier to import your dxf file as metric/mm and tell Onshape to fix their dxf exporter. 

    Onshape Dev please look into correctly setting "insunits" parameter in the file. This appears to be the units that the importing application will default to for the file.
  • Options
    andy_mundell620andy_mundell620 Member Posts: 4 EDU
    OnShape please fix the dxf exporter!!! It is strange that I can select the units to export in 3d, but it defaults to the workspace units when exporting a 2d file.
  • Options
    brett_suttonbrett_sutton Member Posts: 42 ✭✭✭
    Same problem. I exported a file that was designed in mm and the cutter reports that 1m handrail is showing as 26m - so a factor of 25.4 sounds about right.

    Drawing:
    https://cad.onshape.com/documents/f3b03c15b5a38d98937576aa/w/03e00bbfa4b98c92668f399b/e/bdf18c2388397934058580f1

    Here is the pertinent section of the file.

    ```

    INSUNITS
    350
    1000006D
      3

    ```
  • Options
    robert_johnstonrobert_johnston Member Posts: 27 PRO
    I have this issue as well with some laser cutter suppliers. Onshape claim that the dxf is exported unitless however I found the same thing as you with inches being stated even when all parts made in metric environment. Need to be able to force dxf export to either metric or inches. This happens when the laser cutter software reads the information in the dxf to determine the units of measurement. However if the laser cutter software is set to import the dxf in metric or inches it disregards the unit information in the dxf file and just applies inches or mm 1:1. That's why I always have to send a pdf with at least one dimension so they check and scale it on their end if needed.
  • Options
    peter_cuthbertpeter_cuthbert Member Posts: 45
    Hi Folks

    I too am experiences the same problem of metric sheet metal drawings being exported as an imperial DXF.  I also seem to have a 'shrinkage' problem in that the 'flat' drawing in the DXF file is smaller than the dimensions on the original.  I have experimented with the bends being on the inside or outside which obvioulsy will make a millimetre or two difference, but my problem differences are bigger than that.  I attached a picture of the DXF flat layout that has been converted back to MM from inches, dimensioned in my 2D CAD (TurboCAD 16), then the original part drawing side view is added along with a measurement of the length of flange 1 to provide comparison.  Sadly the DXF printour is well off the original drawing.


    Has anybody any idea what is going on?  Is it user error or program error?

    As ever, your thoughts would be welcome.

    Regards

    Pete



  • Options
    martin_kopplowmartin_kopplow Member Posts: 264 ✭✭✭
    edited November 2023
    The DXF is pretty much the same size as your OS model, as shown by the OS measure tape:

    The inside is a bit shorter, the outside a bit longer, but the neutral fiber seems accurate, if it wasn't for the DXF scaling error by the usual 1/25,4, for which a solution has been proposed earlier in this thread.

    Dirty workaround: If your target application (TurboCAD) expects Inches, then you could consider to just serve it what it desires, and use a DXF viewer that supports units switching and scaling on import. I have been using the free version of DoubleCAD for this in a few cases, it has unit settings in the open dialog: 
    Before I did that, I set the DC working units to metric, and only used the itchy inch in the open dialog. That way, I can open an "inchy" DXF in a metric document, get it displayed in Millimetres and save in metric. (I exported as DXF 2010 from OS, for 2013 or 2018 did not open.) I sometimes use this workflow to check files prior to sending them to the laser cutting booth, for DXF is known to be a notorious troublemaker.
  • Options
    itskoitsko Member Posts: 3
    +1, same issue.

    onshape created in mm, export to dxf, import dxf to kicad, appears as if onshape had been in inches.
    kicad has no units override unless no units are specified.

    the scaling ratio from inches back to mm borders on irrational: 0.039370078740157...
    leading to unavoidable truncation errors in kicad.

    This makes the file unusable.
  • Options
    itskoitsko Member Posts: 3
    Dirty fix :

    Export the file.
    Open it with a text editor.
    Use Find (Ctrl+F) to search for $INSUNITS

    You should see:

    $INSUNITS
     70
         1
      9

    Change that 1 (which means [inches] ) to a 4 for [mm].
    Or a 0 for [no set unit].

    Go forth .. but OnShape should fix this.
  • Options
    Sam_SchlageckSam_Schlageck Member Posts: 18 PRO
    itsko said:
    Dirty fix :

    Export the file.
    Open it with a text editor.
    Use Find (Ctrl+F) to search for $INSUNITS

    You should see:

    $INSUNITS
     70
         1
      9

    Change that 1 (which means [inches] ) to a 4 for [mm].
    Or a 0 for [no set unit].

    Go forth .. but OnShape should fix this.
    I tried this method - when I opened the .dxf in eDrawings after editing it in Notepad the parts were measuring the same as in inches but scaled down to mm (e.g. 30 in is now 30 mm)
  • Options
    martin_kopplowmartin_kopplow Member Posts: 264 ✭✭✭
    I tried this method - when I opened the .dxf in eDrawings after editing it in Notepad the parts were measuring the same as in inches but scaled down to mm (e.g. 30 in is now 30 mm)

    I believe that is just what was intended, and it solves the main issue people have with DXF export.
  • Options
    Sam_SchlageckSam_Schlageck Member Posts: 18 PRO
    I tried this method - when I opened the .dxf in eDrawings after editing it in Notepad the parts were measuring the same as in inches but scaled down to mm (e.g. 30 in is now 30 mm)

    I believe that is just what was intended, and it solves the main issue people have with DXF export.
    It doesn't solve it. 30 inches should be reading as 762 mm not 30 mm

    our CAM software is opening up .dxf files generated in OnShape and scaling them down because the units are set to inches, while our CAM system is operating in metric units. Our operators/programmers can set the units to inches in our CAM software and open DXF files generated in OnShape at the correct scale, however all of the measurements for the panels on our BOM and in our models are in metric. 
  • Options
    dirk_van_der_vaartdirk_van_der_vaart Member Posts: 541 ✭✭✭
    Your drawing is scaled?

  • Options
    martin_kopplowmartin_kopplow Member Posts: 264 ✭✭✭
    It doesn't solve it. 30 inches should be reading as 762 mm not 30 mm

    our CAM software is opening up .dxf files generated in OnShape and scaling them down because the units are set to inches, while our CAM system is operating in metric units. Our operators/programmers can set the units to inches in our CAM software and open DXF files generated in OnShape at the correct scale, however all of the measurements for the panels on our BOM and in our models are in metric. 

    That's strange and not what I've seen. Something that says it is 30 units long could be interpreted as 30 inches or 30 millimeters long. Else, it is not wrong units, but scaled, and that might just be a different issue.
Sign In or Register to comment.