# 匯入 DXF 導體供 PEEC 使用 (`field.peecImportDxf`)

[元件參考](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/) · [English](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/commands/field-peecImportDxf/)

**選單:** 無（快速開啟、CLI、Python 與 MCP） · **執行方式:** 立即完成

> 預覽功能：在「編輯 › 偏好設定 › 模擬」開啟預覽功能，或執行 `preview.set {"enabled":true}`。回覆會帶有 `preview: true` 與說明。

以下參數與說明取自指令本身的定義，與 CLI、Python 及 MCP 讀到的文字相同，因此保留英文。

## 說明

Preview. Reads a 2D DXF layout (LINE, ARC, CIRCLE, LWPOLYLINE, POLYLINE in model space) and places each stackup layer at its elevation and thickness, as a Q3D-class extractor imports layout with a layer map: each closed rectangular outline becomes one rectangular field.peec segment along its longer side (width the shorter side, height the layer thickness, at the middle of the copper), ends on one layer within the join tolerance are one node, each stackup layer is joined apart from the others (they overlap in the plane), and every outline that is not a rectangle, is on a layer the stackup leaves out, or overlaps another on its layer, and every edge that closes no outline, is listed in skipped with its reason. Adds to the model given, never replaces it; a non-ASCII layer name fails the import. Changes nothing.

## 參數

- `text`: str (the DXF file's text) | "path":str (a .dxf file, through the host's file service)
- `unit`: "mm|m|cm|dm|um|in|mil|ft"="mm" (the unit of a drawing whose header gives no $INSUNITS)
- `toleranceM`: m? (ends nearer than this are joined; default a millionth of the drawing's diagonal)
- `stackup`: \[{"layer":str (a DXF layer name, ASCII),"elevationM":m (the bottom of its copper),"thicknessM":m (above 0),"resistivity":Ω·m?,"temperatureC":°C? (copied to each segment, as field.peec takes them; default annealed copper at 20 °C)}\] (1 to 64 layers, each once; the layer map)
- `model`: object? (field.peec params to add to; their nodes and segments are kept and the import's appended, everything else is left as given)
- `prefix`: str="dxf" (ASCII; segments are named \<prefix\>1, \<prefix\>2, … and nodes \<prefix\>.n1, …, numbered past the names the model already has)

## 回覆

- model (the field.peec params with the import added; give it ports and frequencies and run field.peec)
- imported:\[{segment,atM:\[x,y\] (a corner of its outline),layer,from,to,lengthM,widthM,thicknessM}\]
- skipped:\[{atM:\[x,y\]|null (a point of the outline or edge),line|null,entity|null,layers,reason}\]
- unit
- unitFromFile
- toleranceM
- notes
