# DipTrace Component Editor Library — 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 Component Editor Library** 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 component library is a single `` root; it **nests** the footprint (pattern) library, then the category tree, then the components: ... ... ... ... ... A plug‑in's data node is `/Library/Components/Component/Part`. Each nested `` in the footprint library carries a `PatternStyle` key that a component `` references to attach its footprint. The nested pattern library's internals are given in the Pattern Editor specification. ## 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. ## \ — component library root Root of a Component Editor library (`.eli` binary / `.elixml` text). It carries the library-wide attributes, then holds one **nested** pattern library (the attached footprints), an optional `` list, a `` tree, and the `` collection. … … … … | Attribute | Type | Written | Description | |----|----|----|----| | `Type` | Text | always | Fixed marker `DipTrace-ComponentLibrary`. | | `Name` | Text | full save | Library name. | | `Hint` | Text | full save | Library caption / hint. | | `Version` | Text | full save | DipTrace product version that wrote the file. | | `UID32` | Int | full save | Random 32-bit library id, freshly regenerated on every save; if absent on import a new one is assigned. | | `Units` | Text | always | File unit for all Reals: `inch`, `mm`, or `mil`. | > **Note.** On a partial plug-in/exchange export only `Type` and `Units` > are emitted; `Name`/`Hint`/`Version`/`UID32` are written only on a > full library save. ### \ — nested footprint library Immediately inside the component-library root sits a complete pattern library holding the footprints. When embedded this way only `Type` and `Units` are written on it; each footprint inside is a `` carrying a `PatternStyle` key that a component `` references. Its full internals (pad types, pads, holes, shapes, 3D model) are the PattEdit dialect. … … … | Attribute | Type | Written | Description | |-----------|------|---------|------------------------------------------------| | `Type` | Text | always | Fixed marker `DipTrace-PatternLibrary`. | | `Units` | Text | always | Same unit convention as the enclosing library. | > **Note.** The `PatternStyle` attribute (reader alias `PatternType`, > since 4.2.0.1) on each nested `` is the unique key referenced > by a part's ``. It is emitted only when the > pattern library is embedded inside a component library. ## \ — library subfolder list An ordered list of the library's subfolder names, written right after the root attributes when the library has any subfolders. A component's `` indexes into this list. Analog Power | Element | Type | Written | Description | |----|----|----|----| | `` | Text | per subfolder | One subfolder name; position in the list is its index. | ## \ — library classification tree The library's three-level classification tree: each `` holds ``, each `` holds ``. Every level carries an `Index` attribute and a `` text child. A component's per-part `` block references this tree by `Index`. Buzzers Magnetic SMD | Attribute | Type | Written | Description | |----|----|----|----| | `Index` | Int | always | Identifier of the category / type / subtype at its level. A component references these by the same `Index` value. | > **Note.** CompEdit uses `Index` for both the library category list and > the per-component reference. (The PattEdit dialect uses `Number` for > the same tree — the two dialects genuinely differ.) ## \ / \ — the components The `` collection holds one `` per library entry. A component is one or more `` sections (gates/units) plus an attached footprint linked from its first part. … … | Attribute | Type | Written | Description | |-----------|------|---------|---------------------------------------------------| | `Id` | Int | always | Zero-based index of the component in the library. | ## \ — a component section One symbol section of the component. Several fields are written on the **first part only** and inherited by the rest: `RefDes`, ``, ``, ``, ``, ``, ``, ``, ``, and ``. Per-part fields (``, ``, ``, ``, ``, ``, ``) are written on every section. AI-1223-TWT-12V-R Part 1 47k C:\Lib\Buzzers.eli$(LIB) http://… …
…
ROHM Semiconductor … … … … …
| Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Zero-based section index within the component. | | `RefDes` | Text | first part only | Reference-designator prefix (e.g. `LS`). | | `PartType` | enum | always | Section electrical role (table below). | | `ShowNumbers` | enum | if \> 0 | Pin-number display mode; omitted when `Common`. | | `Type` | enum | always | Symbol template (table below). | | `Int1` | Int | always | Template parameter 1 (meaning depends on `Type`). | | `Int2` | Int | always | Template parameter 2 (meaning depends on `Type`). | | `Width` | Real | always | Symbol body width. | | `Height` | Real | always | Symbol body height. | | `LockTypeChange` | Bool | always | `Y`/`N` — lock the symbol template against change. | | `SubFolderIndex` | Int | — | Index into the library `` list, or `-1`. Accepted on import but currently **not written** by the serializer. | | Value | Name (PartType) | |-------|---------------------| | `0` | Normal | | `1` | Power | | `2` | Net Port | | `3` | Hierarchy Connector | | `4` | Hierarchy Block | | Value | Name (Type / template) | |-------|------------------------| | `0` | Free | | `1` | 2 Sides | | `2` | IC-2 Sides | | `3` | IC-4 Sides | | Value | Name (ShowNumbers) | |-------|--------------------| | `0` | Common | | `1` | Show | | `2` | Hide | > **Note.** `SubFolderIndex` is defined and read but its emit is > disabled in the current serializer, so a saved file omits it. The > value, when supplied, is the subfolder index (or `-1`) — not the > always-zero placeholder older documentation described. ### \ value elements — \ / \ / \ / \ / \ Text children of a part. `` and `` are per-section; ``, `` and `` are written on the first part only. `` gives the offset from the symbol center to the origin. | Element / Attr | Type | Written | Description | |----|----|----|----| | `` | Text | first part only | Component base name. | | `` | Text | always | Section label (e.g. `Part 1`). | | `` | Text | always | Component value. | | `` | Text | first part only | Datasheet URL / reference. | | `` | Text | first part only | Manufacturer name. | | `Origin X` | Real | always | Origin offset X from symbol center. | | `Origin Y` | Real | always | Origin offset Y (sign-flipped on write/read). | ### \ — source-library path Records where the part's source library lives, as a full path plus an optional environment-variable form. Written on the first part only, and only when either value is non-empty (so ordinary library files omit it). C:\Lib\Buzzers.eli $(LIB)\Buzzers.eli | Element | Type | Written | Description | |----------|------|------------|-------------------------------------------------| | `` | Text | if present | Full source-library path. | | `` | Text | if present | Environment-variable-relative form of the path. | ### \ — attached footprint link Binds the symbol to its footprint. `Style` matches a `PatternStyle` in the nested pattern library. Written on the first part only. | Attribute | Type | Written | Description | |----|----|----|----| | `Style` | Text | first part only | Key of the footprint in the nested pattern library. | > **Note.** The reader also accepts `PatternType` as a 4.2.0.1 alias for > `Style`; the writer emits `Style`. ### \ — SPICE simulation model Per-section SPICE model descriptor. `
` holds an ordered list of `` lines. D1N4148
.model D1N4148 D(…)
| Attribute / Element | Type | Written | Description | |----|----|----|----| | `Type` | enum | always | SPICE primitive: `SubCkt`, `Resistor`, `Capacitor`, `Inductor`, `Diode`, `BJT`, `JFET`, `MOSFET`, and further source/line/switch types. | | `` | Text | if present | Model name / reference string. | | `` | Text | per line | One model-detail line inside `
`. | ### \ (per component) — classification reference First-part-only reference into the library `` tree. Carries the category `Index`, a ``, and a `` list of chosen type/subtype pairs. Buzzers Magnetic SMD | Attribute / Element | Type | Written | Description | |----|----|----|----| | `Index` | Int | if \> -1 | Category index into the library tree. | | `` | Text | if present | Category name. | | `` | Int | per type | Chosen type index; element text is its name. | | `` | Int | if \> -1 | Chosen subtype index; element text is its name. | ### \ — supplier record First-part-only supplier / part-number information. … ROHM … Mouser USD | Element | Type | Written | Description | |------------------|------|------------|----------------------------------| | `` | Text | if present | Octopart / catalog part number. | | `` | Text | if present | Manufacturer name. | | `` | Text | if present | Supplier pattern / package name. | | `` | Text | if present | Supplier name. | | `` | Text | if present | Pricing currency. | ## \ / \ — symbol pins Per-section list of symbol pins. Each pin's position is offset from the symbol center; the pin-to-pad bind is by `PadId` plus the matching `` name. NE PLUS 1 | Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Zero-based pin index within the section. | | `X` | Real | always | Pin X offset from symbol center. | | `Y` | Real | always | Pin Y offset (sign-flipped on write/read). | | `Locked` | Bool | always | `Y`/`N` — pin locked against edit. | | `Type` | enum | always | Pin visual type (table below). | | `ElectricType` | enum | always | ERC electrical type: `Undefined`, `Passive`, `Input`, `Output`, `Bidirectional`, `Open High`, `Open Low`, `Passive High`, `Passive Low`, `3 State`, `Power`. | | `Orientation` | enum | always | Pin direction: `0` / `90` / `180` / `270`. | | `PadId` | Int | always | Numeric index into the footprint pad array (the pin↔pad bind). | | `Length` | Real | always | Pin length. | | `ShowName` | Bool | always | `Y`/`N` — show the pin name. | | `NumXShift` | Real | always | Pad-number label X offset. | | `NumYShift` | Real | always | Pad-number label Y offset (sign-flipped). | | `NameXShift` | Real | always | Pin-name label X offset. | | `NameYShift` | Real | always | Pin-name label Y offset (sign-flipped). | | `SignalDelay` | Real | always | Signal delay value. | | `NumOrientation` | Real | always | Pad-number label rotation. | | `NameOrientation` | Real | always | Pin-name label rotation. | | `Group` | Int | if \> -1 | Owning group id (see ``); omitted when ungrouped. | | Value | Name (Pin Type) | |-------|-----------------| | `0` | Default | | `1` | Dot | | `2` | Polarity In | | `3` | Polarity Out | | `4` | Non Logic | | `5` | Open | | `6` | Open High | | `7` | Open Low | | `8` | 3 State | | `9` | Hysteresis | | `10` | Amplifier | | `11` | Postponed | | `12` | Shift | | `13` | Clock | | `14` | Generator | | Child element | Type | Written | Description | |----|----|----|----| | `` | Text | if present | SPICE node/signal name for the pin. | | `` | Text | if present | Pin name / hint. | | `` | Text | if present | The footprint pad's **name** this pin binds to. | > **Note.** The reader accepts `PadIndex` as an alias for `PadId` (since > 4.2.0.1); the writer emits `PadId`. The symbol-pin ↔ footprint-pad > link is made by the numeric `PadId` together with a matching name: > `` must equal the linked pattern pad's `Number`. > **Note.** `Enabled` on a pin is import-only — honored on the > plugin/exchange import path (a delete flag) but never written by a > normal save (disabled pins are pruned). ### \ — pin-name font Font styling for the pin name, always emitted with the pin. | Attribute | Type | Written | Description | |-----------------|------|---------|---------------------------------------| | `Size` | Int | always | Rounded integer font size. | | `FontSizeFloat` | Real | always | Exact fractional font size. | | `Width` | Real | always | Stroke width factor. | | `Scale` | Real | always | Font scale factor. | | `FontMono` | Bool | always | `Y`/`N` — monospaced vs proportional. | ## \ / \ — symbol graphics and text Per-section list of drawing primitives and text objects. Geometry attributes and children depend on `Type`; text attributes are written only for `Text` shapes. Point coordinates are offsets from the symbol center. Segm | Attribute | Type | Written | Description | |----|----|----|----| | `Id` | Int | always | Zero-based shape index within the section. | | `Type` | enum | always | Shape kind (table below). | | `LineWidth` | Real | if not Text | Stroke width; omitted for `Text`. | | `Locked` | Bool | if locked | `Y` emitted only when locked (absent means not locked). | | `FontVector` | Bool | Text only | `Y`/`N` — vector stroke font vs TrueType. | | `FontMono` | Bool | Text + vector | `Y`/`N`; written only for a vector-font text object. | | `FontSize` | Int | Text only | Rounded integer font size. | | `FontSizeFloat` | Real | Text only | Exact fractional font size. | | `FontColor` | Int | Text only | Integer text color. | | `TextShow` | enum | Text only | What the text object displays (table below). | | `FontName` | Text | Text, if set | TrueType font name. | | `FontWidth` | Real | Text only | Stroke width factor. | | `FontScale` | Real | Text only | Font scale factor. | | `Angle` | Real | Text, if ≠ 0 | Text rotation in radians CCW; omitted when zero. | | `HorzAlign` | enum | Text only | Horizontal anchor: `Center` / `Right` / `Left`. | | `VertAlign` | enum | Text only | Vertical anchor: `Center` / `Bottom` / `Top`. | | `TextAlign` | enum | Text only | Multi-line justification: `Center` / `Right` / `Left`. | | `LineSpacing` | Real | Text only | Line-spacing factor. | | `TextWidth` | Real | Text, computed | Computed text-bounds width (read-only). | | `TextHeight` | Real | Text, computed | Computed text-bounds height (read-only). | | `Group` | Int | if \> -1 | Owning group id; omitted when ungrouped. | | Value | Name (Shape Type) | |-------|-------------------| | `0` | Undefined | | `1` | Line | | `2` | Arc | | `3` | Arrow | | `4` | Rectangle | | `5` | FillRect | | `6` | Obround | | `7` | FillObround | | `8` | Polyline | | `9` | Polygon | | `10` | Text | | Value | Name (TextShow) | |-------|-----------------| | `0` | Any Text | | `1` | Name | | `2` | RefDes | | `3` | Value | | `4` | Part Name | | `5` | Manufacturer | | `6` | Datasheet | | Child element | Type | Written | Description | |----|----|----|----| | `/` | Text | Text shapes only | One `` per line of literal text. | | `/` | Real | if present | Geometry vertices; `Y` is sign-flipped on write/read. | > **Note.** Type index `0` (`Undefined`) is a sentinel, not a drawable > shape. `Enabled` on a shape is import-only (a delete flag on the > plugin/exchange path) and never written by a normal save. ## \ / \ — pin/shape groups Per-section list of named groups that pins and shapes reference by `Id`. Written by the Component Editor. | Attribute | Type | Written | Description | |-----------|------|---------|-----------------------------------------------| | `Id` | Int | always | Group number referenced by pin/shape `Group`. | | `X` | Real | always | Group anchor X. | | `Y` | Real | always | Group anchor Y (sign-flipped). | ## \ / \ — user fields First-part-only list of user-defined fields, each a name/value pair with a type. Tolerance5% | Attribute / Element | Type | Written | Description | |---------------------|------|---------|-------------------------------| | `Type` | enum | always | Field kind: `Text` or `Link`. | | `` | Text | always | Field name. | | `` | Text | always | Field value. | ## \ / \ — internally shorted pads First-part-only list of pad pairs shorted inside the component. `X` and `Y` are **pad `Id` references** — the footprint pad's serialized `Id`, not a coordinate and not the printed pad name/number. Because they are references, **before you delete a pad you must remove or repoint every `` that names it**: a dangling pad `Id` here is not validated on import and surfaces later as a crash, not a clean error. | Attribute | Type | Written | Description | |-----------|------|---------|------------------------------------------------| | `X` | Int | always | First shorted pad — the footprint pad's `Id`. | | `Y` | Int | always | Second shorted pad — the footprint pad's `Id`. |