Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Dimensions not correct when exported from OnShape
tim_higham442
Member Posts: 3 ✭
After getting the sizes wrong on a panel I created, I made a test object 7.5cm by 8.5cm in OnShape, exported to dxf and viewed it in eDrawings - The dimensions it shows there are 190.5mm by 215.9mm. There's obviously something really basic I'm doing wrong here, but am really confused, if anyone can help please - thanks!
1
Best Answers
-
NeilCooke Moderator, Onshape Employees Posts: 5,631DXF is unitless and requires the importing system to provide a way to set the units, but it looks like eDrawings defaults to inches with no way to change it (yay).
You can either set your workspace units to inches before exporting or you can create a drawing with the view of the part (which will import into eDrawings correctly).Senior Director, Technical Services, EMEAI1 -
tim_hess427 Member Posts: 648 ✭✭✭✭I just ran into this issue today. I was trying to quote a laser cut part and exported a dxf from the face of the part. The part studio units are mm, but when I uploaded the dxf to the vendor website, it was interpreted as inches.
I couldn't find a $INSUNITS variable, but I did find $MEASUREMENT based on some googling. Changed a 0 to a 1 in a text editor and re-uploaded. Now, my dimensions are correct.
https://www.practicalmachinist.com/vb/cad-cam/there-something-dxf-file-header-indicating-mm-inch-units-357982/
EDIT: Also want to note that I uploaded the same original dxf (before I modified it) to two different vendors. One system asked for the units and scaled the file appropriately. The other did not ask and it was wrong.1
Answers
You can either set your workspace units to inches before exporting or you can create a drawing with the view of the part (which will import into eDrawings correctly).
DXF specification (Autodesk seems to move the documentation around semi-regularly, so I'm also putting in a link to a downloadable PDF):
http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-A85E8E67-27CD-4C59-BE61-4DC9FADBE74A
https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf
As a workaround, you can switch workspace units to inches, export, then switch workspace units back, and then the DXF should have correctly scaled units.
Edit: looks like I am wrong about the DXF format having units; $INSUNITS does not seem to apply to the whole DXF, but rather seems to be a hint for editors for what scaling to use when inserting additional content into the drawing. Link to the comment in this thread here: https://forum.onshape.com/discussion/comment/70565/#Comment_70565
@alnis is my personal account. @alnis_ptc is my official PTC account.
I couldn't find a $INSUNITS variable, but I did find $MEASUREMENT based on some googling. Changed a 0 to a 1 in a text editor and re-uploaded. Now, my dimensions are correct.
https://www.practicalmachinist.com/vb/cad-cam/there-something-dxf-file-header-indicating-mm-inch-units-357982/
EDIT: Also want to note that I uploaded the same original dxf (before I modified it) to two different vendors. One system asked for the units and scaled the file appropriately. The other did not ask and it was wrong.
@alnis is my personal account. @alnis_ptc is my official PTC account.
https://forums.autodesk.com/t5/autocad-forum/units-settings-within-dxf-files/td-p/7417774
It looks like $INSUNITS and $MEASURMENT variables apply to different things. Based on the above post, it sounds like $INSUNITS is probably only used when it's needed for some sort of attached object. And it looks like $MEASUREMENT is being incorrectly used by some vendors to guess the original drawing units when it really only applies to lines and hatching properties.
In the end, it looks like @NeilCooke is right in that DXF is supposed to be unitless, but different implementations of import software use workarounds to try to assume what the original units were - which causes issues when they're wrong.
I guess since it's the "drawing-units value for automatic scaling of blocks, images, or xrefs when inserted or attached to a drawing" it might be reasonable to assume that the scale applies to existing geometry too? I'm not really sure. I haven't used a 2D CAD system before, so I don't know what the standard practices/conventions are. In any case, it does seem to be that a lot of vendors use it for scaling DXFs in their quoting systems.
@alnis is my personal account. @alnis_ptc is my official PTC account.
The end result is that my DXF files (made in a millimeter workspace) have proper values but some reader software read my 500mm as 500inch as all Onshape DXF exports have the $INSUNITS set to `1`.
If Onshape wants to stick to unitless DXFs that value should probably be set to `0` which the spec defines as `Unitless`.
What do you think?
I am running into a similar issue and cannot seem to use your solutions with any success. I have a part studio whose units are set to inches. When I export the dxf (in 2018 on the export window) and import into cricut design space (yes the little craft maker device), it imports it really large. So I changed to workspace units to mm and did it all again. Still really large. So I then opened AutoCAD to try importing using a more official CAD software and the import is still really large. I am trying to cut gears using craft foam, and gears need to be exact sizes, so this is becoming a struggle. I prefer not to simply guess the scaling factor. Any help? Thanks!
Here is a link to the public gear train document:
https://cad.onshape.com/documents/170b40f8502a593f6a6102be/w/6913f3b44a59b911d5f18473/e/232942776414fc02e9f531a9
What exactly is your workflow when exporting? I just opened your document, right-clicked on a face, and exported it as a 2018 DXF, I then opened it with eDrawings and double-checked dimensions and everything is correct. I would check the settings of the software you're importing into.
Make sure to tell whomever is importing a DXF what units were used for exporting. As an extra check, add some reference feature and call out that it's 10mm (or another appropriate round number) long.
This is sad to see that it exports it wrong. It can't be that hard for Onshape to set $INSUNITS correctly depending on the part studio unit settings....
(See https://ezdxf.readthedocs.io/en/stable/concepts/units.html#measurement )
Post / thread is similar to:
https://forum.onshape.com/discussion/17533/dxf-export-issues