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 分鐘閱讀 · 更新於 · Zorocut 團隊

本指南暫時沒有繁體中文版本:你正在閱讀英文原文。

步驟
  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.

出處

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

卡在別的地方?直接問吧——Zorocut 團隊會回答每一個問題。

提出問題

把套料與報價小技巧寄到你的信箱

大約每月一封電子郵件:套料與報價技巧、社群中常見問題的解法,以及 Zorocut 的最新消息。

大約每月一封電子郵件,內容包含新的切割與報價指南、影片與 Zorocut 消息。我們會先寄一封確認連結給你,你也可以隨時取消訂閱。 隱私權政策

在 Zorocut 中套料並報價

這些指南中的間距規則、單位檢查、起始速度與報價公式,都已內建於 Zorocut Nest 與免費線上套料。你的 DXF 檔案只留在你的電腦上。