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.

Exported DXF is huge

I have set my units of measurement to mm. When I export a dxf to a laser it is 25.4 times bigger. Obviously it is exporting in inches. How do I stop this from happening?

Answers

  • eric_pestyeric_pesty Member Posts: 1,891 PRO
    Are you exporting from a drawing or from a face in the 3D model? Did you set units in the drawing properties or did you change the workspace units?

    Onshape uses meters for everything "behind the scenes" so it seems unlikely that it would export in inches unless specifically set to these units, are you sure you don't have a setting issue on the import side?
  • gary_asplingary_asplin Member Posts: 5 EDU
    I am exporting from a face. Workspace units are set to mm. 
  • eric_pestyeric_pesty Member Posts: 1,891 PRO
    If you are exporting straight from a face then drawing units don't come into play anyway. I still think I would double check your import settings into the other software.
    It it's showing up 24.5 times larger it actually means it's exported in mm but interpreted as inches when imported! Maybe try setting your workspace to inches and see if that helps?
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    It it's showing up 24.5 times larger it actually means it's exported in mm but interpreted as inches when imported! Maybe try setting your workspace to inches and see if that helps?
    Err - 25.4 times larger? ;)
  • dirk_van_der_vaartdirk_van_der_vaart Member Posts: 549 ✭✭✭
    edited February 2023
    Some tips;
    Export DXF 2004 instead of the default 2018
    Check your Account setting's , are they in mm, they can differ from the document settings..

  • eric_pestyeric_pesty Member Posts: 1,891 PRO
    It it's showing up 24.5 times larger it actually means it's exported in mm but interpreted as inches when imported! Maybe try setting your workspace to inches and see if that helps?
    Err - 25.4 times larger? ;)
    Yes, 25.4 times larger means it's exported in mm and imported assuming inches! Not the other way around...

    If Onshape exports something that is 100mm long with a value of "100 units" in the exported file but the software you import it in thinks it's inches, it will read this "100 unit" long thing and interpret it as a 100 inches, or 2540mm!

    If Onshape was exporting in inches, then it would make something 25.4 mm long "1 unit" in the exported file and if you imported that assuming it was mm you would get something 1mm long!

  • gary_asplingary_asplin Member Posts: 5 EDU
    The units in Onshape are mm. I exported the file as AutoCad 2004. I open the dxf in AutoCad which has units set in mm. It measures the correct size. Import the dxf into the laser software (import units in import settings are mm) but it is exactly 25.4 times larger. I just have to scale it down. Seems that will be something I just have to deal with. Thank you for your suggestions.
  • rhys_skinnerrhys_skinner Member Posts: 9 PRO
    Onshape does not correctly set "insunits" parameter in the dxf file.

    Many software use this parameter to 'pick' the units the dxf is supposedly in, especially automatic quoting software and random laser cutter software as discussed.

    This is the problem. 
    "insunits" parameter in the dxf file not being set to metric. Open the file in a text editor and change that parameter so it represents metric (can't recall if it were a 1 or 0 setting)
  • eric_pascualeric_pascual Member Posts: 2 EDU
    Onshape does not correctly set "insunits" parameter in the dxf file.

    Many software use this parameter to 'pick' the units the dxf is supposedly in, especially automatic quoting software and random laser cutter software as discussed.

    This is the problem. "insunits" parameter in the dxf file not being set to metric. Open the file in a text editor and change that parameter so it represents metric (can't recall if it were a 1 or 0 setting)
    Millions of thanks man, you're my hero :smile:

    I was struggling trying to use the exported DXF file in bCNC, and was forced to scale them each time by using its operations once imported. Which is a real PITA as you can imagine.

    As suggested by several users, I've checked and both the workspace and the document units are set to mm. I've also tried different DXF versions in the export dialog, by no way. I confess not having tried all of them, but at least all the ones that were suggested here and there.

    Changing :
    $INSUNITS
    70
        1
    9
    
    to :
    $INSUNITS
    70
        4
    9
    
    in my favorite text editor did the trick.

    Note: 1 means inches and 4 means mm

    This looks like a bug in the DXF export process, which doesn't seem to take into account the current settings.

    In the meantime I'll try to write a small Python script to edit the DXF with the help of the appropriate package.
  • martin_kopplowmartin_kopplow Member Posts: 514 PRO
    edited November 2023
    Since this issue is already ages old and occurs in many applications, it may be worth searching the internet for someone who already did write this script. ;)
    BTW.: I have been using a text file search and replace utility for that on my former Linux box to batch convert. Maybe that still works.
Sign In or Register to comment.