# DipTrace PCB Layout — XML Format Specification *Generated from the DipTrace serializer, repository revision 7276 — reflects current program behaviour.* ## How to read this specification This document describes the **DipTrace PCB Layout** flavour of the DipTrace XML format — the same format used both for `File ▸ Save/Open As ▸ DipTrace XML` and for the plug‑in exchange file. It is generated directly from the DipTrace serializer and reflects what the program actually reads and writes. Each element is given with a short description, a representative XML fragment, and a table of its attributes. The **Written** column states the condition under which the serializer emits the attribute (`always`, a guard such as `if >-1`, or a context such as `Text shapes only`); an attribute left at its default is usually omitted, so a missing attribute means *use the default*, not zero. ## Document structure A PCB project is a single `` root holding the embedded design‑cache library and the editable board: ... ... ... ... The `` is the project's *design cache* — a full component library that **nests** the footprint (pattern) library inside it (its internals are given in the Pattern Editor specification). In a PCB file this design‑cache library carries only `Type` and `Units`. The editable board data lives under `` (a plug‑in's data node is `/Source/Board`). ## Value types & formatting | Type | Encoding | |----|----| | `Int` | A plain decimal integer. | | `Real` | A decimal number expressed in the file's `Units`, written with a **dot** decimal separator. The reader is tolerant (it normalises both dot and comma), but the dot is canonical and is what other tools expect. | | `Bool` | `Y` / `N`. (A few Schematic simulator fields use `+` / `-`.) | | `Text` | A string attribute or element text. | | `Color` | A 24‑bit integer in Windows `0x00BBGGRR` order (e.g. `255` = red). | | enum | A fixed set of text (or, in a few cases, integer) values, listed with the element. | ## Coordinate frames, units & angles - The document root carries `Units="mm" | "inch" | "mil"`. **Every** `Real` coordinate, length and size in the file is in those units; there is no per‑object override. - Objects inside a library symbol or footprint (pins, pads, shapes) are stored in an **object‑centre** frame — coordinates are relative to the part/footprint origin and are not affected by where an instance is placed. - Angles are in **radians, counter‑clockwise**, unless an attribute is explicitly a discrete orientation enum (e.g. a footprint `Orientation` of `0/90/180/270`). - Coordinate scaling and sign are internal to the file; read and write values as they are — do not rescale or flip them. ## Identifiers, references & list ordering - Most list elements carry an `Id` (or `Index`/`Number`) that other objects reference. A reference value of `-1` means *none / not connected*. - A few lists are referenced **positionally**, not by an `Id` attribute: a `ViaStyle` value indexes the in‑order `` list and a `NetClass` value indexes the in‑order `` list. Reordering those lists silently reassigns the references. - When a whole file is opened, top‑level object lists are resolved **by position**: each array must be dense, ascending from `Id` 0, with position equal to `Id`. A file authored out of order or with gaps will bind references to the wrong objects. ## Object state flags | Attribute | Type | Meaning | |----|----|----| | `Selected` | Bool | User selection state. | | `Locked` | Bool | Edit lock. | | `Group` | Int | Group `Id`, or `-1` for none; groups are listed in a `` section. | | `Enabled` | Bool | *Exists / removed.* A normal save prunes disabled objects, so a saved file rarely shows `Enabled="N"`; on the plug‑in exchange / edit‑import path, however, `Enabled="N"` is honoured as a **delete** flag on the editable objects. An absent flag means enabled. | ## Plug-in exchange & import merge The same format is the **plug-in exchange** file: DipTrace exports the selected data, launches the plug-in with the file path as its argument, waits for it to exit, then re-imports the (possibly edited) file. How the result merges back depends on the import mode: - **Whole-list (`ImpMode=All`)** — the incoming list *replaces* the project's list of that object kind; anything omitted is removed. - **`Edit`** — each **top-level** object is matched to an existing one **by its `Id`** and overwritten in place; an object with a new or absent `Id` is added. Keep an object's `Id` to edit it, and **omit the `Id`** on objects you add — never invent one, because over a partial export a computed “free” Id can collide with an unexported object and overwrite it. > **Nested lists without their own `Id` are REPLACED, not merged.** A > net's ``, a net's or bus's ``, and point lists have no > per-member `Id`. When such a container is present in your XML, > DipTrace **discards the existing list and rebuilds it from exactly the > children you supply** — so appending one trace under an existing net > replaces that net's *entire* routing. To add one member, re-list every > current member plus the new one; to leave the list untouched, omit the > container element entirely. > **The `Selected` filter skips — it does not add.** When a plug-in runs > with a `Selected` filter under `Edit`, only objects flagged > `Selected="Y"` are processed at all: a marked object with an existing > `Id` is edited, a marked object with a new `Id` is added, and an > **unflagged** object is **skipped entirely** (neither edited nor > added). Put `Selected="Y"` on every object you add or edit under such > a filter, or its data is silently dropped. To remove an object, set `Enabled="N"` on it and leave it in the file (see *Object state flags*) — do not delete the XML node. Component and Pattern *library* files use coarser Library / Component / Part import modes rather than per-object `Edit`, but the `Enabled` delete flag and the `Id` rules still apply. > **A note on completeness.** Where a newer serializer field has no > counterpart in an older published table (for example the > real‑valued/mono font fields, or per‑object shield‑group ids), it is > documented here as a first‑class attribute. Preserve attributes and > elements you do not recognise when editing a file in place — they > belong to other subsystems and to future format versions. ## Cross-cutting attribute families Two families of attributes recur across many PCB elements. They are defined once here; each element's own table then refers back to this section rather than repeating the semantics. ### ShieldGroup family A via-stitching / shielding-group membership id. All values are `Int` indices into the board's shield-group registry; `-1` or an absent attribute means the object belongs to no shield group. Most carriers emit the attribute only when it is greater than `-1`; trace-point carriers emit it unconditionally. | Attribute | Type | Written | Description | |----|----|----|----| | `ShieldGroup` | Int | if \>-1 | Shield-group id on ``, ``, ``, ``, and diff-pair ``/``. | | `ShieldGroup` | Int | always | On a routed trace `` and on diff-pair ``/`` points it is emitted on every point. | | `TraceShieldGroup` | Int | if \>-1 | Second shield group carried by `` (the pour's trace-side group). | | `PosShieldGroup` | Int | if \>-1 | Positive-side shield group on a diff-pair center point. | | `NegShieldGroup` | Int | if \>-1 | Negative-side shield group on a diff-pair center point. | ### Real-valued and mono font family Every text object stores its font size twice: a legacy rounded integer `FontSize` and a companion real value. On import the real value takes precedence and overrides the rounded integer, so a reader that only understands `FontSize` still gets a usable value while a full reader keeps sub-unit precision. | Attribute | Type | Written | Description | |----|----|----|----| | `FontSizeFloat` | Real | always (text) | Unrounded font size; overrides the rounded `FontSize` on import. On title-block ``, ``, text ``, ``, ``, ``. | | `MarkingFontSizeFloat` | Real | always | The `` marking twin of `FontSizeFloat`. | | `FontMono` | Bool (Y/N) | vector fonts only | Monospace flag; emitted only when the object uses a vector (stroke) font. Same carriers as `FontSizeFloat`. | | `TextWidth` | Real | text, export-only | Computed bounding-box width of the rendered text. Derived output — written for convenience, not read back. | | `TextHeight` | Real | text, export-only | Computed bounding-box height. Derived output, not read back. On ``, text ``, ``, ``. | | `FontColor` | Int | always | Title-block `` font color (unconditional there). | > **Note.** `Enabled="N"` is an import-honored delete flag rather than a > routinely written attribute. A normal save prunes disabled objects, so > it rarely appears on disk, but the importer honors it on the editable > objects (shapes, nets, diff pairs, groups, …) to mark deletions in the > plug-in / exchange path. ## \ and \ — document root The file root is ``. It carries the format identity and the unit system, then holds the embedded design-cache `` followed by the single `` that contains the whole project. `` itself has no attributes; it is a container. … … | Attribute | Type | Written | Description | |----|----|----|----| | `Type` | Text | always | Always `DipTrace-PCB` for this dialect. | | `Version` | Text | always | Product version that wrote the file. | | `Units` | enum | always | File unit system: `mm`, `mil`, or `inch`. All `Real` coordinates and sizes below are expressed in these units. | ## \ — embedded design cache The project's design cache: a full CompEdit-format component library that nests its pattern library inside it (it is not a second sibling library). In a PCB file it is written in cache mode, so at the outer level it carries only `Type` and `Units` — the component-library `Version`/`Name`/`Hint`/`UID32` fields are omitted. … footprints … … … | Attribute | Type | Written | Description | |----|----|----|----| | `Type` | Text | always | Outer library is `DipTrace-ComponentLibrary`; the nested block is `DipTrace-PatternLibrary`. | | `Units` | enum | always | Library unit system. | > **Note.** The nested `` holds > the footprints that placed components reference by `PatternStyle`; its > internal structure is the PattEdit dialect and is documented there. In > a PCB file the design-cache library shows only `Type` and `Units` — do > not expect the standalone component-library header fields. ## \ — board edge polygon The board edge. A `` list of `` vertices, each of which may be the start of an arc, plus panelization and lock flags. Y is stored flipped (screen-down positive). | Attribute | Type | Written | Description | |----------------|------------|---------|-----------------------------------------| | `ShieldGroup` | Int | if \>-1 | See cross-cutting family. | | `PanelExclude` | Bool (Y/N) | if Y | Exclude this outline from panelization. | | `Locked` | Bool (Y/N) | if Y | Outline is locked from editing. | | `Selected` | Bool (Y/N) | if Y | Outline is selected. | ### \ (BoardOutline) | Attribute | Type | Written | Description | |-----------|------------|---------|--------------------------------------------| | `X` | Real | always | Vertex X. | | `Y` | Real | always | Vertex Y (stored negated). | | `Arc` | Bool (Y/N) | always | Whether this vertex begins an arc segment. | ## \ — panelization V-scoring or tab-routing panel parameters. All attributes below are written unconditionally. 25.4 76.2 19.05 | Attribute | Type | Written | Description | |----|----|----|----| | `Type` | enum | always | Panel mode (see enum). | | `Columns` | Int | always | Board columns in the panel. | | `Rows` | Int | always | Board rows in the panel. | | `ColumnSpacing` | Real | always | Gap between columns. | | `RowSpacing` | Real | always | Gap between rows. | | `PanelizeSingle` | Bool (Y/N) | always | Panelize a single board. | | `RailShow` | Bool (Y/N) | always | Show border rails. | | `RailLeft`/`RailRight`/`RailTop`/`RailBottom` | Real | always | Rail widths on each side. | | `LeftGap`/`RightGap`/`TopGap`/`BottomGap` | Real | always | Board-to-rail gaps on each side. | | `TabWidth` | Real | always | Routing-tab width. | | `TabRadius` | Real | always | Tab corner radius. | | `TabStep` | Real | always | Spacing between tabs. | | `HoleDiam` | Real | always | Mouse-bite hole diameter. | | `HoleStep` | Real | always | Mouse-bite hole spacing. | | `HoleInset` | Real | always | Mouse-bite hole inset. | | `HoleKeepout` | Real | always | Mouse-bite keepout. | | `TabsDone` | Bool (Y/N) | always | Tabs have been generated. | | `CombinedRadius` | Real | always | Combined-tab radius. | | `KeepMaterial` | Bool (Y/N) | always | Keep material at tabs. | | `BorderTabs` | Real | always | Border-tab parameter. | | Value | Name | |-------|-------------| | `0` | V-Scoring | | `1` | Tab Routing | > **Note.** `` and `` are lists of **bare numeric > values**, not ``-wrapped children — the serializer writes the > values inline with no per-value tag. Contrast the title-block > ``/`` lists, which really do use ``. ## \ — drawing sheet, zones, title blocks Sheet geometry, border-zone lettering, and up to six title blocks. Coordinate children use lowercase-p tags ``/`` (the reader is case-insensitive). The title-visibility children and the border-zone / title-block sub-tree are written only in a full document export. Y Y 0 0 100 297 210 10 10 10 10 … … | Child | Type | Written | Description | |----|----|----|----| | `DisplayTitles` | Bool (Y/N) | full export | Show title blocks. | | `DisplaySheet` | Bool (Y/N) | full export | Show sheet border. | | `Xpos`/`Ypos` | Real | always | Sheet origin on screen. | | `Scale` | Real | always | Sheet scale, percent. | | `SheetWidth`/`SheetHeight` | Real | always | Sheet size. | | `LeftMargin`/`TopMargin`/`RightMargin`/`BottomMargin` | Real | always | Sheet margins. | ### \ Border-zone lettering (the A/B/C… 1/2/3… grid around the sheet). | Child | Type | Written | Description | |----|----|----|----| | `Visible` | Bool (Y/N) | always | Show zone lettering. | | `HorzZones` | Int | always | Number of horizontal zones. | | `VertZones` | Int | always | Number of vertical zones. | | `Standard` | Int | always | Numbering standard. | | `FontName` | Text | always | Zone-label font. | | `FontSize` | Real | always | Zone-label font size (fractional values allowed). | | `FontLineWidth` | Real | always | Stroke width; a negative value is a relative-to-size ratio, a positive value is an absolute width. | | `Border` | Bool (Y/N) | always | Draw the zone border frame. | | `HorzBorderSize`/`VertBorderSize` | Real | always | Border frame sizes. | > **Note.** `FontSize` and `FontLineWidth` here are `Real`, not integers > — they are written unrounded and can carry fractional values. ### Title blocks and \ Six title-block elements share one structure: ``, ``, ``, ``, ``, ``. A block is written only when its name is non-empty. It carries `Width`/`Height` attributes and a ``, a ``/`` pair (each an `` list), a `` grid of border-flags, and a `` list of text fields. Default 3090 10 Title Tahoma | Attribute (Field) | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Field index within the block. | | `FontVector` | Bool (Y/N) | always | Vector (stroke) vs TrueType font. | | `FontMono` | Bool (Y/N) | vector only | See font family. | | `FontSize` | Int | always | Rounded font size (legacy). | | `FontSizeFloat` | Real | always | Overrides `FontSize` on import. | | `FontWidth` | Real | always | Stroke width; negative = ratio to size, positive = absolute. | | `FontScale` | Real | always | Font aspect scale. | | `LineSpacing` | Real | always | Multi-line spacing. | | `TextWidth`/`TextHeight` | Real | text fields, export-only | Computed extents; see font family. | | `TextShow` | enum | always | Field content mode (see enum). | | `TextAlign` | enum | always | Text alignment (see enum). | | `FontColor` | Int | always | Field color. | | `X1`/`Y1`/`X2`/`Y2` | Real | always | Field rectangle within the block. | | Value | Name (TextShow) | |-------|-----------------| | `0` | Text | | `1` | Sheet | | `2` | File | | Value | Name (TextAlign) | |-------|------------------| | `0` | Left | | `1` | Center | | `2` | Right | The `` grid nests two levels of `` (rows then cells); each leaf cell carries `FieldId` (Int) and `TopLine`/`BottomLine`/`LeftLine`/`RightLine` (Y/N) border flags. ``/`` and `` are written only for text fields (`TextShow="Text"`). ## \ — global project settings The largest settings block. It opens with a `` font+field sub-tree, then grid, origin, snap, line-width, routing, layer-panel, and a run of scalar flag children. … Tahoma … field nodes … … … … Current Only … … … N Silk C:\proj ### \ Default component-marking font plus per-field silk/assembly show & align. | Item | Type | Written | Description | |-----------------|------------|-------------|-------------------------------------| | `CompRotate` | Bool (Y/N) | always | Rotate markings with the component. | | `FontVector` | Bool (Y/N) | always | Vector vs TrueType default font. | | `FontMono` | Bool (Y/N) | vector only | See font family. | | `FontName` | Text | always | Default marking font. | | `FontSize` | Int | always | Rounded default size. | | `FontSizeFloat` | Real | always | Overrides `FontSize` on import. | | `FontWidth` | Real | always | Stroke width. | | `FontScale` | Real | always | Aspect scale. | Inside `` follow the per-field display nodes ``, ``, ``, ``, ``, ``, and ``/`` (user fields, each with a ``). Every field node carries the same four attributes: | Attribute | Type | Written | Description | |-------------|------|---------|-----------------------| | `SilkShow` | enum | always | Silkscreen show mode. | | `SilkAlign` | enum | always | Silkscreen alignment. | | `AssyShow` | enum | always | Assembly show mode. | | `AssyAlign` | enum | always | Assembly alignment. | | Value | Name (Show) | |-------|-------------| | `0` | Common | | `1` | Show | | `2` | Hide | | Value | Name (Align) | |-------|--------------| | `0` | Common | | `1` | Center | | `2` | Top | | `3` | Bottom | | `4` | Left | | `5` | Right | | `6` | Corner | | `7` | Auto | | `8` | Position | ### \, \, \ (auto-snap) | Item | Type | Written | Description | |----|----|----|----| | `Grid` · `Visible` | Bool (Y/N) | always | Grid on. | | `Grid` · `Snap` | Bool (Y/N) | always | Snap to grid. | | `Grid` · `Size` | Real | always | X grid step. | | `Grid` · `YSize` | Real | always | Y grid step. | | `Grid` · `YIdentical` | Bool (Y/N) | always | Y step equals X step. | | `Origin` · `Visible` | Bool (Y/N) | always | Show axes. | | `Origin` · `AxisColor` | Int | always | Axis color. | | `Origin` · `X`/`Y` | Real | always | Origin position. | | `Assembly` · `Pads`/`Silk`/`CompBorders`/`BoardOutline` | Bool (Y/N) | always | Auto-snap targets. | ### \ and \ | Item | Type | Written | Description | |----|----|----|----| | `LineWidth` · `Silk`/`Table`/`Titles`/`BoardOutline`/`Assembly`/`CompOutline`/`Courtyard` | Real | always | Default line widths per class. | | `Routing` · `Router` | enum | always | Router grid mode (see enum). | | `Routing` · `TraceWidth`/`TraceClearance`/`BoardClearance`/`ViaSize`/`ViaHole`/`FanoutLength` | Real | always | Routing defaults. | | Value | Name (Router) | |-------|---------------| | `0` | Shape | | `1` | Grid | ### \ and scalar settings `` holds per-layer visibility as Y/N attributes: `TopAssy`, `TopMask`, `TopPaste`, `BotAssy`, `BotMask`, `BotPaste`, `TopTerminals`, `BotTerminals`, `TopCourtyard`, `BotCourtyard`, `TopOutline`, `BotOutline`, `TopDimensions`, `BotDimensions`, plus a `` child list of Y/N ``s (one per non-signal layer). The remaining `` children are scalars: | Child | Type | Written | Description | |----|----|----|----| | `LayerDisplayMode` | enum | always | Current Only / All Layers / Contrast. | | `EditInactiveLayer` | Bool (Y/N) | always | Allow editing on inactive layers. | | `StackLength` | Bool (Y/N) | always | Include stack in length calc. | | `SignalDelayLength` | Bool (Y/N) | always | Use signal-delay length. | | `SolderMaskSwell` | Real | always | Global mask swell. | | `PasteMaskShrink` | Real | always | Global paste shrink. | | `ShowCompFiducials` | Bool (Y/N) | always | Show component fiducials. | | `RelatedSchem` | Path/Var | always | Linked schematic (``/``). | | `SchemNetClasses` | Bool (Y/N) | always | Net classes originated from the related schematic. | | `TopComponentLock`/`BottomComponentLock` | Bool (Y/N) | always | Side component locks. | | `LockNetStructure` | Bool (Y/N) | always | Lock net structure. | | `FlipTextAuto` | Bool (Y/N) | always | Auto-flip bottom text. | | `JumperLayer` | enum | always | Silk / Assembly / Signal / Do Not Show. | | `ProjectDir` | Text | always | Project directory. | | Value | Name (LayerDisplayMode) | |-------|-------------------------| | `0` | Current Only | | `1` | All Layers | | `2` | Contrast | | Value | Name (JumperLayer) | |-------|--------------------| | `0` | Silk | | `1` | Assembly | | `2` | Signal | | `3` | Do Not Show | ## \ — library folders and files The project's library search paths. Two child lists — `` of `` and `` of `` — each entry being a ``/`` pair (a literal path plus an environment-variable form). C:\lib$(LIB) C:\lib\res.eli | Attribute | Type | Written | Description | |-----------|------------|---------|-------------------------------------| | `Sorted` | Bool (Y/N) | always | Whether the library list is sorted. | ## \ / \ — signal and plane layers The copper stack. Each ``'s `Id` is the target of every copper `Lay`/`LayId` reference elsewhere in the file. Top GND | Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Layer id; reference target for `Lay`/`LayId`. | | `Type` | enum | always | Signal or Plane. | | `PlanePad` | enum | always | Plane thermal mode (By Pads / Fixed Ring). | | `NetId` | Int | if \>-1 | For a plane layer, the net it belongs to. | | `PlaneRing` | Real | always | Plane thermal-relief ring. | | `Color` | Int | always | Layer display color. | | `Locked` | Bool (Y/N) | if Y | Layer locked. | | Value | Name (Type) | |-------|-------------| | `0` | Signal | | `1` | Plane | | Value | Name (PlanePad) | |-------|-----------------| | `0` | By Pads | | `1` | Fixed Ring | ## \ / \ — custom non-signal layers Notes | Attribute | Type | Written | Description | |-----------|------|---------|------------------------------------------------------| | `Id` | Int | always | Non-signal layer id; target of a Non-Signal `LayId`. | | `Side` | enum | always | None / Top / Bottom. | | `Color` | Int | always | Display color. | | Value | Name (Side) | |-------|-------------| | `0` | None | | `1` | Top | | `2` | Bottom | ## \ / \ — stack-up and materials `` is a bare text element naming the stack. `` holds one `` per physical layer, each pointing at a copper layer by `Lay` and carrying a ``. Default Copper | Attribute | Type | Written | Description | |----|----|----|----| | `LayerStackItem` · `Lay` | Int | always | Copper-layer index this item covers. | | `Material` · `Type` | enum | always | Conductor / Plane / Dielectric. | | `Material` · `VariableThickness` | Bool (Y/N) | always | Thickness varies. | | `Material` · `Thickness` | Real | always | Layer thickness. | | `Material` · `Constant` | Real | always | Dielectric constant. | | `Material` · `TraceWidth` | Real | always | Reference trace width for impedance. | | Value | Name (Material Type) | |-------|----------------------| | `0` | Conductor | | `1` | Plane | | `2` | Dielectric | ## \ — hierarchy blocks Registered hierarchy sheets. Each `` has a number and name and an optional `` list linking instances (``, carrying a `UId` and a ``). PowerBlock U1 | Attribute | Type | Written | Description | |---------------------|------|---------|---------------------| | `HSheet` · `Number` | Int | always | Sheet number. | | `UId` · `UId` | Int | always | Instance update id. | ## \ / \ — via styles The in-order list of via styles. A via-style reference elsewhere (a trace point's `ViaStyle="N"`) is a **positional index** into this list; `-1` means no style. Do not reorder the list — that silently reassigns every reference. Default Buried | Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Equal to the style's position in the list. Written for readability; the reader ignores it and resolves references positionally. | | `Size` | Real | always | Via pad diameter. | | `HoleSize` | Real | always | Via drill diameter. | | `Lay1`/`Lay2` | Int | if not through | Start/end copper layers for a blind/buried via. Emitted only when the style does not span the full stack; when absent the via is a through via. | > **Note.** There is no `Through` attribute — through vs blind/buried is > derived from `Lay1`/`Lay2`: a style with no `Lay1`/`Lay2` (or one > spanning the full stack) is a through via, otherwise it is > blind/buried. ## \ / \ — net-class rules The in-order list of net classes. A net's `NetClass="N"` is a **positional index** into this list — reordering silently reassigns rules. Each class carries per-layer width/clearance properties, an allowed-via list, and autorouting constraints. Default … 0 | Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Equal to list position; written for readability, ignored on read (references are positional). | | `UpdateId` | Int | always | Cross-reference id (schematic net-class link). | | `Type` | enum | always | Normal or Differential Pair. | | `AllLayers` | Bool (Y/N) | always | One property row for all layers vs per-layer rows. | | `CheckLength` | Bool (Y/N) | always | Enforce length limits. | | `AllVias` | Bool (Y/N) | always | Allow all via styles. | | `PerformDRC` | Bool (Y/N) | always | Include class in DRC. | | `Phase`/`Phase_ErrorLength`/`LengthDelta` | Real | always | Diff-pair phase and length tolerances. | | `FixedLength` | Real | if \>-1 | Target fixed length; omitted (= longest-connection mode) when `-1`. | | `MaxUncoupledLength`/`Tolerance` | Real | always | Diff-pair uncoupled-length limit and matching tolerance. | Each `` carries `Width` (if \>-1), `MinWidth`, `MaxWidth`, `Clearance` (if \>-1), the diff-pair-only neck fields (`Neck_Width`, `Neck_DifClearance`, `Neck_MaxLength`, `DifClearance`, written only when `Type`=Differential Pair), an optional `` (only in per-layer mode), and a `` object-to-object clearance sub-matrix. The `` child holds `RoutePriority`/`PriorityValue`, `RouteMaxVias`/`MaxViasValue`, `RouteMaxIncorrectWay`/`MaxIncorrectWayValue`, `RouteAllLayers`, and a `` Y/N `` list. | Value | Name (Type) | |-------|-------------------| | `0` | Normal | | `1` | Differential Pair | > **Note.** `MaxIncorrectWayValue` is a `Real` (written and read > unrounded, with no unit coefficient), not an integer. ## \ — class-to-class clearances The upper-triangular matrix of clearances between net classes. Each `` names two classes by index. When the pair uses one clearance for all layers, a single `Clearance` attribute is written; otherwise a `` child lists a per-layer `` for each copper layer. A clearance of `-1` means "not set / inherit". | Attribute | Type | Written | Description | |----|----|----|----| | `Enabled` | Bool (Y/N) | always | Whether class-to-class checking is on. | | `Cell` · `NetClass1`/`NetClass2` | Int | always | The two net-class indices. | | `Cell` · `Clearance` | Real | all-layers case | Single clearance for the pair (`-1` = unset). Present only when the pair is all-layers. | | `Lay` · `Id`/`Clearance` | Int / Real | per-layer case | Copper-layer index and its clearance. | ## \ — design-rule set The DRC configuration: a run of check-enable flags, then per-layer clearance and size records. When `AllLayers="Y"`, the per-layer lists collapse to a single record. Y 1 N … | Attribute | Type | Written | Description | |----|----|----|----| | `AllLayers` | Bool (Y/N) | always | Single ruleset for all layers. | | `CheckClearance`/`CheckSize`/`CheckJumpers`/`CheckCopperPours`/`CheckClassToClass`/`CheckSilk`/`CheckLength`/`CheckKeepouts`/`CheckSameNet`/`CheckSameComponentPads`/`CheckCourtyard` | Bool (Y/N) | always | Individual DRC check toggles. | | `SilkClearance` | Real | always | Silk-to-copper clearance. | | `ShowList` | Bool (Y/N) | always | Show the error-list panel. | | `RealTimeMode` | Int | always | Real-time DRC mode. | | `DRCDone` | Bool (Y/N) | always | DRC has been run. | Each `` carries `Lay` and the same-net clearances `SameTraceToTrace`, `SameSmdToVia`, `SameSmdToPad`, `SameSmdToSmd` (all Real), plus a `` sub-matrix of the object-pair clearances (`TraceToTrace`, `TraceToVia`, … `DrillToBoard` — the upper triangle over the object types Trace/Via/Pad/Smd/Copper/Drill/Board). Each `` carries `Lay`, `MinTrace`, `MinDrill`, `MinRing`, `MaxRing`, `MaxPlatedHole`, `MaxNonPlatedHole` (all Real). > **Note.** When `AllLayers="Y"` both `` and `` > emit exactly one record with `Lay="0"` and stop — there is no > per-layer expansion. Read the single record as applying to every > layer. ## \ — connectivity/obstacle flags Three flags governing what the interactive connectivity check treats as an obstacle. | Attribute | Type | Written | Description | |---------------|------------|---------|------------------------| | `Traces` | Bool (Y/N) | always | Consider traces. | | `Shapes` | Bool (Y/N) | always | Consider shapes. | | `CopperPours` | Bool (Y/N) | always | Consider copper pours. | ## \ / \ — length matching `` is the single primary rule; `` is the list of additional ``s. The two share the same shape: a target/type header plus a `` list of measured connections. Main | Attribute | Type | Written | Description | |----|----|----|----| | `Type` | enum | always | By User or By NetClass. | | `FixedLength` | Real | if \>-1 | Target length; omitted (= longest-connection target) when `-1`. | | `Delta` | Real | always | Allowed deviation. | | `AnyError` | Bool (Y/N) | always | Rule has any error. | | `NetClass` | Int | always | Net-class index (or `-1`). | | `Rule` · `NetId` | Int | always | Net of the measured connection. | | `Rule` · `Comp1`/`Pad1`/`Comp2`/`Pad2` | Int | always | The two endpoints (component id + pad id). | | `Rule` · `Length` | Real | always | Measured length. | | `Rule` · `Error` | Bool (Y/N) | always | Endpoint is in error. | | Value | Name (Type) | |-------|-------------| | `0` | By User | | `1` | By NetClass | > **Note.** `` (inside ``) uses the identical > attribute set and the same ``/`` children as > ``. ## \ / \ — group registry The registry of object groups. Only enabled groups are written. A `Group="N"` reference on any object points at a `` by its `Id`; `-1` means ungrouped. | Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Group id (reference target for `Group` attributes). | | `Selected` | Bool (Y/N) | if Y | Group is selected. | ## \ / \ — placed components The `` list holds every placed `` — footprints, plus the special stand-alone objects (free pad, mounting hole, static via, fiducial). Each component carries its placement, marking display, and its own `` list. C1 10SVP10M 47 | Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Component index; what nets/ratlines/diff pairs reference together with a pad `Id`. | | `UpdateId` | Int | always | Hidden id linking back to the source schematic part (`-1` = none). | | `Type` | enum | if `tp>10` | Special object kind (`Pad`/`MtHole`/`Via`/`Fiducial`). Absent for ordinary footprints. Distinct from `PatternStyle`. | | `PatternStyle` | Text | if not a static via | Footprint-style name referencing a footprint in the embedded pattern library. A free-text style name, not an enum value. | | `ViaStyle` | Int | Via objects only | For a static-via component (`Type="Via"`): positional index into the `` list. Written in place of the placement/marking block. | | `X` / `Y` | Real | always | Placement origin. | | `Angle` | Real | if ≠0 | Rotation, radians CCW. | | `Side` | enum | ordinary components | `Top` or `Bottom`. | | `Flip` | Bool (Y/N) | if set | Mirror flag; written only when `Y`. | | `HorzFlip` | Bool (Y/N) | if set | Horizontal-mirror flag; written only when `Y`. | | `ShowFiducials` | enum | if \>0 | `Common`/`Show`/`Hide`. | | `CustomMarkingFont` | Bool (Y/N) | if set | Component overrides the global marking font. | | `MarkingFontSize` | Int | ordinary components | Marking font height, rounded. | | `MarkingFontSizeFloat` | Real | ordinary components | Unrounded twin of `MarkingFontSize`; overrides the rounded value on import. | | `MarkingFontAll` | Bool (Y/N) | if set | Font applies to all marking fields. | | `GridAlign` | enum | ordinary components | `Pad` or `Origin` — the point the grid snaps to. | | `PlacementClearance` | Real | if \>0 | Extra placement clearance around the component. | | `PanelExclude` | Bool (Y/N) | if set | Excluded from panelization. | | `Group` | Int | if \>-1 | Group registry id. | | `ShieldGroup` | Int | if \>-1 | Shared shield/stitching-group id. | | `Locked` | Bool (Y/N) | if set | Placement locked. | | `Selected` | Bool (Y/N) | if set | Selection state. | Text children: ``, ``, ``. Ordinary components also emit optional add-field lists and the marking sub-elements below. | Value | Name | |-------|----------| | `14` | Pad | | `15` | MtHole | | `16` | Via | | `20` | Fiducial | > **Note.** `Type` and `PatternStyle` are unrelated. `Type` (written > only for the special `tp>10` objects) names the object kind; > `PatternStyle` is the footprint-style name an ordinary placed > component references. A static via (`Type="Via"`, internal `tp=16`) > and a mounting hole (`Type="MtHole"`, `tp=15`) skip the > placement/marking block entirely. ### \ marking sub-elements Six per-field marking blocks describe how each component field is drawn on silk and on the assembly layer: ``, ``, ``, ``, ``, ``. Each contains a `` and an `` child. | Attribute | Type | Written | Description | |----|----|----|----| | `Show` | enum | always | `Common`/`Show`/`Hide` — visibility of this field on the layer. | | `Align` | enum | always | Placement anchor (`Common`/`Center`/`Top`/`Bottom`/`Left`/`Right`/`Corner`/`Auto`/`Position`). | | `Horz` | enum | always | Horizontal text alignment (`Center`/`Right`/`Left`). | | `Vert` | enum | always | Vertical text alignment (`Center`/`Bottom`/`Top`). | | `X` / `Y` / `Angle` | Real | always | Field offset and rotation (`Angle` radians). | ### \ Each `` under a component's ``. The pad's `NetId` is the authoritative carrier of net membership. | Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Pad number within the component. | | `NetId` | Int | always | Owning net's `Id` (`-1` = unconnected). Authoritative — DipTrace derives ratlines and the net's `` mirror from this. | | `SignalDelay` | Real | if \>0 | Extra pin/package delay added to length-matching. Omitted when 0. Not written for static-via objects. | | `InternalConnection` | Int | ordinary pads | Internal-connection group index within the component (`-1` = none). | | `ShieldGroup` | Int | if \>-1 | Shared shield/stitching-group id. | Optional pad children: ``/`` (layer lists), ``, ``, and — for static-via objects — ``. ### \ Per-pad mask and paste overrides, emitted under a static-via pad when any state or swell/shrink differs from default. States and swell/shrink are attributes; explicit mask/paste opening geometry lives in ``/``. | Attribute | Type | Written | Description | |----|----|----|----| | `TopMask` / `BotMask` | enum | if state \>0 | Top/bottom solder-mask opening mode. | | `TopPaste` / `BotPaste` | enum | if state \>0 | Top/bottom paste opening mode. | | `Segment_Percent` | Real | segmented paste | Paste coverage percent (when a paste state selects the segmented mode). | | `Segment_EdgeGap` / `Segment_Gap` / `Segment_Side` | Real | segmented paste | Segmented-paste edge gap, inter-segment gap, and side margin. | | `CustomSwell` | Real | if set | Mask swell override (absent = inherit). | | `CustomShrink` | Real | if set | Paste shrink override (absent = inherit). | ### \ / \ \ Explicit mask/paste opening rectangles. Each `` is a segment given by two corner points. | Attribute | Type | Written | Description | |-------------|------|---------|----------------| | `X1` / `Y1` | Real | always | First corner. | | `X2` / `Y2` | Real | always | Second corner. | > **Note.** These `` children are the one place a segment/point > container carries *geometry* as ``. Elsewhere `` denotes a > reference (net ``), and geometry point lists use ``. ## \ / \ — unrouted connections The ratline list is auto-generated by DipTrace from pad `NetId` membership; a plug-in does not hand-build it. Each `` is a straight guide between two pads.
BOM ... RefDes 01 RefDes
| Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Table index. | | `X1`/`Y1`/`X2`/`Y2` | Real | always | Table box corners. | | `Layer` | enum | always | Documentation layer (see enum). | | `NonSignal` | Int | always | Non-signal-layer id (when on a custom layer). | | `Orientation` | enum | always | `0`/`90`/`180`/`270`. | | `HideBorder` | Bool (Y/N) | always | Hide the table border. | | `TextAlign` | enum | always | Default cell alignment (`Left`/`Center`/`Right`). | | `FontVector` | Bool (Y/N) | always | Default vector font. | | `FontMono` | Bool (Y/N) | vector default | Default monospaced vector font. | | `FontSize` | Int | always | Default cell font height, rounded. | | `FontSizeFloat` | Real | always | Unrounded default font height. | | `FontWidth` / `FontScale` | Real | always | Default stroke width / scale. | | `LineSpacing` | Real | always | Default cell line spacing. | | `Group` | Int | if \>-1 | Group registry id. | | `PanelExclude` | Bool (Y) | if set | Excluded from panelization. | | `Locked` / `Selected` | Bool (Y) | if set | State flags. | Text children `` and ``. | Value | Name (Layer) | |-------|--------------| | `0` | Top Assy | | `1` | Top Silk | | `2` | Bottom Silk | | `3` | Bottom Assy | | `4` | Non-Signal | ### \ The generation spec. `RowType` is written for every document type (its value comes from a different enum for Pick-and-Place than for other types). | Attribute | Type | Written | Description | |----|----|----|----| | `Type` | enum | always | Document type: `Text`/`LayerStack`/`BOM`/`Pick and Place`/`Hole Size`. | | `Units` | enum | always | `Common`/`inch`/`mil`/`mm`. | | `RowType` | enum | always | For Pick-and-Place: `All`/`Top`/`Bottom`. Otherwise: `Components`/`Name`/`Name and Value`/`Name and Pattern`/`Name, Value and Pattern`. | | `Header` | Bool (Y/N) | always | Include a header row. | | `assyvariant` | Int | always | Assembly-variant index. | | `bomindex` / `bomtotal` | Bool (Y/N) | always | BOM index / total columns. | | `pickoff` X/Y, `pickmirror`, `pickorigin` | Real/Bool | always | Pick-and-place origin offset, mirror and origin flags. | Text children: ``, ``, and `` (unconditional). Child `` holds `` entries — each with a `Type` (column-kind index), `Align`, `Width`, a `` and a ``. ### \<RowComponents\> / \<RowCom\> / \<Item\> Per-row component-id lists: each `<RowCom>` is one table row and holds the component `Id`s it aggregates as text `<Item>` values. ### \<Cells\> / \<Cell\> The grid. `<Cells>` holds one `<Cell>` per row, and each row `<Cell>` holds the row's cell `<Cell>` boxes. Every cell is a self-contained text box. | Attribute | Type | Written | Description | |----|----|----|----| | `X1`/`Y1`/`X2`/`Y2` | Real | always | Cell box corners. | | `TextAlign` | enum | always | Cell alignment (`Left`/`Center`/`Right`). | | `FontVector` / `FontMono` | Bool (Y/N) | always / vector | Cell font family. | | `FontSize` / `FontSizeFloat` | Int / Real | always | Cell font height, rounded and unrounded. | | `FontWidth` / `FontScale` | Real | always | Stroke width / scale. | | `LineSpacing` | Real | always | Cell line spacing. | | `TextWidth` / `TextHeight` | Real | with text, computed | Derived text bounding size (export-only). | Cell text children: `<FontName>` and a `<TextLines>`/`<TextLine>` list. ## \<Dimensions\> / \<Dimension\> Dimensions and pointer callouts. A dimension records its measured points, the dimension-line origin, its layer, the objects it snaps to, and text/font settings. <Dimension Id="0" Type="Horizontal" X1="10" Y1="5" X2="30" Y2="5" XD="20" YD="8" Layer="Top Silk" Units="mm" ShowUnits="Y" Connected1="Pad" Connected2="Pad"> <PointerText>20.00 mm</PointerText> </Dimension> | Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Dimension index. | | `Type` | enum | always | `Horizontal`/`Vertical`/`Free`/`Radius`/`Pointer`. | | `PointerMode` | enum | Pointer only | `Coordinates` or `Comment`. | | `X1` / `Y1` | Real | always | First measured point. | | `X2` / `Y2` | Real | always | Second measured point. | | `XD` / `YD` | Real | always | Dimension-line origin. | | `Layer` | enum | always | Board layer (board-layer enum, e.g. `Top Silk`). | | `NonSignal` | Int | always | Non-signal-layer id (when applicable). | | `Angle` | Real | always | Text angle. | | `Size` | Real | always | Arrow/extension size. | | `ExternalRadius` | Real | always | Radius-dimension extension factor. | | `Units` | enum | always | `Common`/`inch`/`mil`/`mm`. | | `ShowUnits` | Bool (Y/N) | always | Append the unit label. | | `Connected1` / `Connected2` | enum | always | Kind of object each end snaps to (`Pad`/`Pattern Shape`/`Pattern Hole`/`Net`/`Plane`/`Shape`/`Board Outline`/`Origin`/`Panel`). | | `cn1`/`cl1`/`cp1`, `cn2`/`cl2`/`cp2` | Int | always | Object reference quads for the two connection ends. | | `FontVector` / `FontMono` | Bool (Y/N) | always / vector | Font family. | | `FontSize` / `FontSizeFloat` | Int / Real | always | Font height, rounded and unrounded. | | `FontWidth` / `FontScale` | Real | always | Stroke width / scale. | | `TextWidth` / `TextHeight` | Real | computed | Derived text bounding size (export-only). | | `Group` | Int | if \>-1 | Group registry id. | | `PanelExclude` | Bool (Y) | if set | Excluded from panelization. | | `Locked` / `Selected` | Bool (Y) | if set | State flags. | Text children: `<FontName>` and `<PointerText>` (the dimension/pointer caption).