Skip to content

DXF units: mm or inch, and why parts come in 25.4× too big or too small

A part that comes in 25.4 times too large or too small was read in the wrong unit: drawn in inches and read as mm, or the reverse. A DXF stores bare numbers and its only unit flag, $INSUNITS, is often 0 (unitless) or missing — so check the overall size of every imported part before you nest or quote it.

5 phút đọc · Cập nhật · Đội ngũ Zorocut

Hướng dẫn này hiện được hiển thị bằng tiếng Anh: bạn đang đọc bản gốc tiếng Anh.

Các bước
  1. Look at the part's overall size right after import
  2. If it is 25.4× off, set the units by hand (mm or inch) and check the size again
  3. Fix the source: export the DXF again with its unit set, or ask the customer which unit they drew in

What the file actually says

Every coordinate in a DXF is a plain number. The header variable $INSUNITS names the unit: 0 = unitless, 1 = inches, 2 = feet, 4 = millimetres, 5 = centimetres, 6 = metres. Autodesk's own reference describes it as the default unit for DesignCenter blocks — weaker than “the unit of the drawing” — and many exporters leave it at 0 or do not write it at all.

  • $MEASUREMENT (0 = imperial, 1 = metric) only picks hatch and linetype files; it says nothing about the coordinates.
  • $LUNITS is the display format (decimal, architectural…), not a scale.
  • Blocks are not converted either: only an INSERT's own scale factor changes their size.

The 25.4 test

A 100 mm bracket drawn in mm but read as inches becomes 2540 mm long — longer than a 1250 × 2500 mm sheet. A 4 in plate drawn in inches but read as mm becomes 4 mm — a speck. The error is obvious if you look at the size and invisible if you only look at the shape. It is also the costliest quoting mistake: cut length is off by 25.4× and area by about 645×, and the price follows both.

How Zorocut reads the units

  • If $INSUNITS is set (inches, feet, mm, cm, m…), Zorocut uses it and says so: “Read as mm — the file says so”.
  • If it is 0 or missing, Zorocut guesses: a drawing no larger than 120 units whose points lie mostly on a 1/16 grid (…0.5, …0.25, …0.0625) is read as inches, anything else as mm. The pre-cut check then shows “Units guessed”, so you look at the size.
  • You can override it per part (Units: From file / mm / inch) in Zorocut Nest, and the DXF checker shows every part's size and flags a guessed unit.

Files from Inkscape and SVG

Inkscape writes $INSUNITS from the document unit, and a document in px is written as 0 (unitless) at 96 px per inch. Such a file arrives with numbers 3.78 times larger than millimetres (96 ÷ 25.4). For SVG files Zorocut reads the width, height and viewBox; without a size in mm it takes one unit as 1/96 inch (1/72 inch for Adobe Illustrator files) and warns you to check the part sizes.

Fix it at the source

  1. AutoCAD: set the INSUNITS variable to 4 (mm) or 1 (inch) before you save the DXF.
  2. Fusion, SolidWorks and Inkscape: set the document or export unit to mm before exporting.
  3. When a customer sends a unitless file, ask “mm or inch?” and write the answer on the quote.

Nguồn

  1. Autodesk, AutoCAD 2012 DXF Reference ($INSUNITS, OCS, entities)
  2. ezdxf documentation, DXF Units
  3. Inkscape extensions, DXF outlines exporter (dxf_outlines.py)

Đang vướng chuyện khác? Cứ hỏi — đội ngũ Zorocut trả lời mọi câu hỏi.

Đặt câu hỏi

Mẹo nesting và báo giá gửi thẳng vào hộp thư của bạn

Khoảng một e-mail mỗi tháng: mẹo nesting và báo giá, cách khắc phục những vấn đề mọi người hay hỏi trong cộng đồng, và tin tức về Zorocut.

Khoảng một e-mail mỗi tháng với các hướng dẫn mới về cắt và báo giá, video và tin tức về Zorocut. Trước tiên chúng tôi gửi e-mail kèm liên kết để bạn xác nhận, và bạn có thể hủy đăng ký bất cứ lúc nào. Chính sách quyền riêng tư

Nesting và tính giá trong Zorocut

Quy tắc khoảng cách, kiểm tra đơn vị, tốc độ mẫu và công thức báo giá trong các hướng dẫn này đều được tích hợp sẵn trong Zorocut Nest và bản nesting trực tuyến miễn phí. File DXF của bạn nằm lại trên máy bạn.