Skill: yanranxiaoxi/easyeda-api (version 1.1.3)

--- name: easyeda-api description: >- EasyEDA Pro API skill for AI agents. Use when working with EasyEDA Pro EDA software, including PCB design, schematic editing, footprint/symbol management, and project operations. Supports live debugging in EasyEDA and EasyEDA extension development. Provides complete API reference (120+ classes, 62 enums, 70 interfaces), extension-development documentation, and a WebSocket bridge server to execute code in the running EasyEDA Pro client. Trigger on: "嘉立创EDA，启动！", "立创EDA，启动！", "EDA，启动！", "EasyEDA", "PCB", "schematic", "footprint", "EDA", "circuit board", "嘉立创EDA", "原理图", "PCB设计". **IMPORTANT**: 嘉立创EDA's English name is **EasyEDA**. They are the SAME product. Never use other transliterations like "EasyEDA Pro" (unless specifically versioned), "EASYEDA", "easyeda", etc. Always use "EasyEDA" for English references and "嘉立创EDA" for Chinese references. license: MIT compatibility: Requires Node.js 18+, EasyEDA Pro desktop client with extension support metadata: author: JLCEDA version: "1.1.3" openclaw: requires: bins: - node env: - CLAUDE_SKILL_DIR --- # EasyEDA Pro API Skill Control EasyEDA Pro (嘉立创EDA专业版) programmatically through AI. This skill provides: 1. **Complete API reference** — 120 classes, 62 enums, 70 interfaces, 19 type aliases 2. **WebSocket bridge** — Execute code in the running EasyEDA Pro client 3. **Code patterns** — Common operations for PCB, schematic, library, and project management 4. **Document source format reference** — File format specifications for project, schematic, and PCB sources when users need to analyze or modify EasyEDA document source directly instead of using the API This skill supports not only live debugging in EasyEDA, but also EasyEDA extension development. During EasyEDA extension development, AI agents can use the extension-related documentation, API references, type information, usage examples, and bridge-based debugging capabilities provided by this skill to look up APIs, write code, and validate behavior during integration and debugging. ## Architecture ``` ┌───────────┐ HTTP/WS ┌─────────────────┐ WebSocket ┌───────────┐ │ AI Agent │ ◄───────────► │ Bridge Server │ ◄───────────► │ EasyEDA │ │ │ Port Range │ (Node.js) │ Port Range │ (Client) │ └───────────┘ 49620-49629 └─────────────────┘ 49620-49629 └───────────┘ ``` The server auto-selects an available port from 49620-49629 on startup. Both AI and EDA clients auto-discover the server by scanning the port range and verifying a handshake (`service: "easyeda-bridge"`). ## Quick Start ### 1. Command Triggers When user says **"嘉立创EDA，启动！"**, **"立创EDA，启动！"**, or **"EDA，启动！"**: **IMPORTANT: Session initialization** — Reply immediately with this exact text to set the correct session title: ``` 📋 EasyEDA Session ``` Then proceed with the setup steps below. ### 2. Install dependencies (if needed) ```bash cd ${CLAUDE_SKILL_DIR} && npm install ``` ### 3. Start bridge server > **⚠️ IMPORTANT**: The bridge server must run in the background. Do NOT run it in the foreground, or the AI will block waiting for the server to exit. ```bash # Check if bridge is already running for port in $(seq 49620 49629); do resp=$(curl -s http://localhost:$port/health 2>/dev/null) if echo "$resp" | grep -q '"easyeda-bridge"'; then echo "Bridge already running on port $port" BRIDGE_PORT=$port break fi done # Start bridge if not running if [ -z "$BRIDGE_PORT" ]; then node ${CLAUDE_SKILL_DIR}/scripts/bridge-server.mjs & sleep 2 # Find the port bridge is running on for port in $(seq 49620 49629); do resp=$(curl -s http://localhost:$port/health 2>/dev/null) if echo "$resp" | grep -q '"easyeda-bridge"'; then BRIDGE_PORT=$port break fi done fi echo "Bridge running on port: ${BRIDGE_PORT:-unknown}" ``` ### 4. Connect EasyEDA Install the `run-api-gateway.eext` extension in EasyEDA Pro. Download link: - https://ext.lceda.cn/item/oshwhub/run-api-gateway After the extension is loaded, it will automatically establish the WebSocket connection. ### 5. Verify connection and select EDA window ```bash # Check bridge and EDA connection status curl http://localhost:${BRIDGE_PORT:-49620}/health # List all connected EDA windows curl http://localhost:${BRIDGE_PORT:-49620}/eda-windows ``` The `/eda-windows` response looks like: ```json { "windows": [ { "windowId": "abc-123", "connected": true, "active": true }, { "windowId": "def-456", "connected": true, "active": false } ], "activeWindowId": "abc-123", "count": 2 } ``` **Handle based on window count**: - **0 windows**: Tell user "No EasyEDA window is connected. Please ensure the EasyEDA extension (run-api-gateway.eext) is installed and loaded in EasyEDA. Download: https://ext.lceda.cn/item/oshwhub/run-api-gateway" - **1 window**: Auto-selected as active. Tell user: "✅ Connected! Active EDA window: abc-123. Ready to work." - **2+ windows**: Show the available windows and ask user to select: ``` Multiple EDA windows detected: - abc-123 (active) - def-456 Which EDA window should I use? ``` **Select a window**: ```bash curl -X POST http://localhost:${BRIDGE_PORT}/eda-windows/select \ -H "Content-Type: application/json" \ -d '{"windowId": "abc-123"}' ``` After selection, confirm: "✅ Active EDA window: abc-123. Ready to work." ### 6. Execute code on EDA ```bash curl -X POST http://localhost:${BRIDGE_PORT:-49620}/execute \ -H "Content-Type: application/json" \ -d '{"code": "return await eda.dmt_Project.getCurrentProjectInfo();"}' ``` ## API Documentation The full API reference is in the [references/](references/) directory: - [references/_index.md](references/_index.md) — Master index of all classes, enums, interfaces, and types - [references/_quick-reference.md](references/_quick-reference.md) — All method signatures for rapid lookup - `references/classes/` — 120 class docs (DMT_*, PCB_*, SCH_*, LIB_*, SYS_*, IPCB_*, ISCH_*) - `references/enums/` — 62 enum docs - `references/interfaces/` — 70 interface docs - `references/types/` — 19 type alias docs ### How to look up API 1. **Start with `_index.md`** to find the right class/module for the task 2. **Read the class doc** (e.g., `references/classes/DMT_Board.md`) for all methods and signatures 3. **Use `_quick-reference.md`** for fast method signature lookup across all classes 4. **Check enums/interfaces** for parameter types and return types ### Document Source Format Documentation If the user needs to analyze or modify EasyEDA document source directly instead of using the API, use the documents in the [format/](format/) directory. - [format/index.md](format/index.md) — Overview of the EasyEDA document source format references and version notes - `format/project/` — Project source structure, metadata, blobs, variants, and grouping data - `format/schematic/` — Schematic source format, including structure, wires, shapes, pins, components, and tables - `format/pcb/` — PCB source format, including primitives, pads and vias, shapes, text, attributes, rules, and panel data Use these files when the task is about understanding source layout, generating compatible document source, or editing source data that will later be imported back into EasyEDA. ### API Module Overview | Prefix | Domain | Key Classes | |--------|--------|-------------| | `DMT_` | Document management | Board, EditorControl, Folder, Panel, Pcb, Project, Schematic, SelectControl, Team, Workspace | | `PCB_` | PCB & Footprint | Document, Drc, Event, Layer, Net, Primitive, PrimitiveComponent, PrimitiveLine, PrimitivePad, PrimitivePour, PrimitiveVia, SelectControl | | `SCH_` | Schematic | Document, Event, Primitive, PrimitiveComponent, PrimitiveWire, SelectControl | | `LIB_` | Library | 3DModel, Cbb, Classification, Device, Footprint, LibrariesList, PanelLibrary, SelectControl, Symbol | | `SYS_` | System | Dialog, Environment, FileManager, FileSystem, FontManager, HeaderMenu, I18n, IFrame, LoadingAndProgressBar, Log, Message, MessageBox, MessageBus, PanelControl, Setting, ShortcutKey, Storage, Timer, ToastMessage, WebSocket, Window | | `IPCB_` | PCB interfaces (图元) | PrimitiveArc, PrimitiveComponent, PrimitivePad, PrimitiveFill, PrimitivePour, PrimitiveRegion, PrimitiveVia, ... | | `ISCH_` | Schematic interfaces (图元) | PrimitiveArc, PrimitiveComponent, PrimitiveWire, PrimitiveText, PrimitiveRectangle, ... | | `EPCB_` / `ESCH_` | Enums | PrimitiveType, Layer, PadType, ... | ## Code Execution Context All code runs inside EasyEDA Pro's browser runtime as: ```javascript async function(eda) { // Your code here — `eda` is the global EDA API object // You MUST use `return` to send results back // Do not add comments to the generated code, as the code is typically executed as a single line } ``` **Critical rules:** - The `eda` object provides access to all API modules (e.g., `eda.dmt_Board`, `eda.pcb_Primitive`). - Always refer to the API documentation for correct usage. - Do not add comments to the generated code, as the code is typically executed as a single line. - Always use `return` to get results — `console.log` output is NOT captured. - All API methods returning promises must be `await`ed. - Code runs in browser context — no Node.js APIs (fs, path, etc.) available. - Use `eda.sys_Message.showToastMessage(msg)` for user-visible notifications. - When reviewing API documentation and encountering enumerations, do not guess the enumeration values. You must use the enumeration members, for example: `EPCB_LayerId.TOP` instead of `1` for the layer parameter in PCB primitive creation. ### Extension Runtime Constraints When writing EasyEDA extensions, standard browser APIs are **forbidden** in the main process. Use EDA-provided alternatives: | Purpose | ❌ Forbidden | ✅ Use Instead | |---------|-------------|----------------| | Get user input | — | `eda.sys_Dialog.showInputDialog()` | | User selection | — | `eda.sys_Dialog.showSelectDialog()` | | Show message | `alert()` | `eda.sys_Dialog.showInformationMessage()` | | Confirm action | `confirm()` | `eda.sys_Dialog.showConfirmationMessage()` | | Toast notification | DOM manipulation | `eda.sys_Message.showToastMessage()` | | Store data | `localStorage` (main process) | `eda.sys_Storage.setExtensionUserConfig(key, value)` | | Custom UI | Manipulate host DOM | `eda.sys_IFrame.openIFrame()` | | Show HTML | `showInformationMessage(html)` | Must use iframe | | Open link | `window.open()` | `eda.sys_Window.open()` | | Browser hardware API | Use in main process | Available in iframe (`navigator.serial`, etc.) | **Note:** `localStorage`, `window`, `document` etc. are available **inside `sys_IFrame`** but NOT in the main extension process. ### Extension ↔ IFrame Data Passing The main extension process and `sys_IFrame` iframe are **isolated contexts**. To pass data between them: **Option A (Recommended):** Use `eda.sys_Storage` as a bridge ```javascript // In main extension process: await eda.sys_Storage.setExtensionUserConfig('myKey', JSON.stringify(data)); // In iframe: const data = JSON.parse(await eda.sys_Storage.getExtensionUserConfig('myKey')); ``` **Option B:** Both contexts can access `eda` directly — call the same API from either side ```javascript // In iframe HTML (NOT window.parent.eda): const info = await eda.dmt_Project.getCurrentProjectInfo(); ``` ## Communication Protocol ### Port Discovery The bridge server listens on the first available port in **49620-49629**. To find the server, scan the range and verify the service identity: ```bash for port in $(seq 49620 49629); do resp=$(curl -s http://127.0.0.1:$port/health 2>/dev/null) if echo "$resp" | grep -q '"easyeda-bridge"'; then BRIDGE_PORT=$port; break fi done ``` ### Handshake - **HTTP**: `GET /health` returns `{ "service": "easyeda-bridge", "edaConnected": bool, ... }` - **WebSocket**: On connect, server sends `{ "type": "handshake", "service": "easyeda-bridge" }` - Clients MUST verify `service === "easyeda-bridge"` before using the connection ### Message Format JSON messages over WebSocket / HTTP: | Field | Type | Description | |-------|------|-------------| | `type` | `"execute"` \| `"result"` \| `"error"` \| `"ping"` \| `"pong"` \| `"handshake"` | Message type | | `id` | `string` | Request UUID for matching request/response | | `code` | `string` | JavaScript code to execute (for `execute` type) | | `result` | `any` | Execution result (for `result` type) | | `error` | `string` | Error message (for `error` type) | | `service` | `string` | Service identifier (for `handshake` type) | | `timestamp` | `number` | Unix milliseconds | ## Common Patterns ### Project & Board Operations ```javascript // Get current project info return await eda.dmt_Project.getCurrentProjectInfo(); // List all boards in project return await eda.dmt_Board.getAllBoardsInfo(); // Create a new board (optionally link to schematic/PCB) return await eda.dmt_Board.createBoard(); // Switch to a document tab await eda.dmt_EditorControl.activateDocument(tabId); ``` ### Example: Open a project by name and open its first schematic page ```javascript const targetProjectName = 'NE555 Circuit'; // 1. Enumerate projects by team/folder and find the target by name const teams = await eda.dmt_Team.getAllTeamsInfo(); const seenProjectUuid = new Set(); let targetProjectUuid = null; for (const team of teams || []) { const teamProjects = await eda.dmt_Project.getAllProjectsUuid(team.uuid); for (const projectUuid of teamProjects || []) { if (seenProjectUuid.has(projectUuid)) continue; seenProjectUuid.add(projectUuid); const info = await eda.dmt_Project.getProjectInfo(projectUuid); const name = info?.friendlyName || info?.name || ''; if (name === targetProjectName) { targetProjectUuid = projectUuid; break; } } if (targetProjectUuid) break; const folderUuids = await eda.dmt_Folder.getAllFoldersUuid(team.uuid); for (const folderUuid of folderUuids || []) { const folderProjects = await eda.dmt_Project.getAllProjectsUuid(team.uuid, folderUuid); for (const projectUuid of folderProjects || []) { if (seenProjectUuid.has(projectUuid)) continue; seenProjectUuid.add(projectUuid); const info = await eda.dmt_Project.getProjectInfo(projectUuid); const name = info?.friendlyName || info?.name || ''; if (name === targetProjectName) { targetProjectUuid = projectUuid; break; } } if (targetProjectUuid) break; } if (targetProjectUuid) break; } if (!targetProjectUuid) { throw new Error(`Project not found: ${targetProjectName}`); } // 2. Open the project const opened = await eda.dmt_Project.openProject(targetProjectUuid); if (!opened) { throw new Error(`Failed to open project: ${targetProjectName}`); } // 3. Get the first schematic page and open it const schematics = await eda.dmt_Schematic.getAllSchematicsInfo(); if (!Array.isArray(schematics) || schematics.length === 0) { throw new Error(`No schematics found in project: ${targetProjectName}`); } const firstSchematic = schematics[0]; const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo(); const firstPage = (pages || []).find((page) => page.parentSchematicUuid === firstSchematic.uuid) || firstSchematic.page?.[0]; if (!firstPage) { throw new Error(`No schematic page found in: ${firstSchematic.name}`); } const tabId = await eda.dmt_EditorControl.openDocument(firstPage.uuid); return { projectUuid: targetProjectUuid, schematicUuid: firstSchematic.uuid, pageUuid: firstPage.uuid, tabId, }; ``` **Notes:** - `dmt_Project.getAllProjectsUuid()` is **not** a global no-arg enumerator in practice. To reliably find a project by name, iterate teams first, then folders. - `openProject(projectUuid)` may discard unsaved changes in the currently opened project. Be careful before calling it. ### PCB Primitive Operations ```javascript // Get selected primitives const selected = eda.pcb_SelectControl.getAllSelectedPrimitives_PrimitiveId(); // Create a line on copper layer // Layer parameter uses EPCB_LayerId enum — see references/enums/EPCB_LayerId.md await eda.pcb_PrimitiveLine.create( "GND", // net (string) EPCB_LayerId.TOP, // layer — use enum, NOT raw number 0, // startX (unit: 1mil) 0, // startY (unit: 1mil) 1000, // endX (unit: 1mil) 0, // endY (unit: 1mil) 10, // lineWidth false // primitiveLock ); // Modify an existing primitive (async pattern) const prim = await eda.pcb_PrimitiveComponent.get([id]); const asyncPrim = prim.toAsync(); asyncPrim.setState_X(newX); asyncPrim.setState_Y(newY); asyncPrim.done(); ``` ### PCB Async Primitive Pattern (IMPORTANT) For **modifying** PCB/SCH primitives, you must use the async pattern: ```javascript // 1. Get the primitive const prim = await eda.pcb_PrimitiveVia.get([viaId]); // 2. Convert to async mode const asyncPrim = prim.toAsync(); // 3. Set new values asyncPrim.setState_X(newX); asyncPrim.setState_Y(newY); asyncPrim.setState_Diameter(diameter); // 4. Apply changes asyncPrim.done(); ``` ### Schematic Operations ```javascript // Get all pages return await eda.dmt_Schematic.getAllSchematicDocumentsInfo(); // Create a schematic component // component parameter requires {libraryUuid, uuid} object — NOT a plain string await eda.sch_PrimitiveComponent.create( { libraryUuid: "...", uuid: "device-uuid-from-library" }, // component object 5000, // x (unit: 0.01inch = 10mil) 5000, // y (unit: 0.01inch = 10mil) "", // subPartName 0, // rotation (degrees, plain number) false, // mirror true, // addIntoBom true // addIntoPcb ); // Get selected schematic primitives const ids = eda.sch_SelectControl.getAllSelectedPrimitives_PrimitiveId(); ``` ### Library Operations ```javascript // List all libraries in workspace return await eda.lib_LibrariesList.getAllLibrariesList(); // Search devices return await eda.lib_Device.search("STM32"); // Get symbol info return await eda.lib_Symbol.get(symbolUuid); ``` ### System Functions ```javascript // Show toast message eda.sys_Message.showToastMessage("Operation complete!"); // Show confirm dialog const confirmed = await eda.sys_Dialog.showConfirmationMessage("Proceed?"); // File system (limited to extension sandbox) const content = await eda.sys_FileSystem.readFileFromFileSystem(path); await eda.sys_FileSystem.saveFileToFileSystem(path, content); ``` ### DRC (Design Rule Check) ```javascript // Run DRC check const passed = await eda.pcb_Drc.check(true, true, false); // passed is boolean: true if DRC passed, false if errors found ``` ## Common Mistakes ### Read API Signatures Carefully (CRITICAL) **Before calling ANY API method, you MUST read the full signature from `references/` — including parameter types, return type, and remarks.** AI agents frequently make these errors due to skimming documentation: **Error 1: Not `await`ing Promise-returning methods** Almost all EDA API methods return `Promise<T>`. If you forget `await`, you get a Promise object instead of the actual result. ```javascript // WRONG: Missing await — result is a Promise, not the project info const project = eda.dmt_Project.getCurrentProjectInfo(); console.log(project); // Promise { <pending> } // CORRECT: Always await async methods const project = await eda.dmt_Project.getCurrentProjectInfo(); console.log(project); // { uuid: "...", name: "...", ... } ``` **How to know if a method needs `await`:** Check the return type in the signature. If it says `Promise<...>`, you MUST `await` it. ```typescript // From references/classes/DMT_Project.md: getCurrentProjectInfo(): Promise<IDMT_ProjectItem | null> // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // This is a Promise — you MUST await it ``` **Error 2: Using raw numbers instead of enum values** Many parameters expect specific enum values. Using wrong numbers silently produces incorrect behavior. ```javascript // WRONG: What does layer "1" mean? Which copper layer? Signal? Mask? await eda.pcb_PrimitiveLine.create("GND", 1, 0, 0, 1000, 0, 10, false); // CORRECT: Use the enum — EPCB_LayerId.TOP is clear and type-safe // Check references/enums/EPCB_LayerId.md for the correct value await eda.pcb_PrimitiveLine.create("GND", EPCB_LayerId.TOP, 0, 0, 1000, 0, 10, false); ``` **Always look up enums in `references/enums/` before using numeric constants.** **Error 3: Assuming parameter types without checking** Different APIs use different units, different ID formats, and different optional parameter conventions. Never assume. ```javascript // WRONG: Assuming create() parameters match modify() parameters // create() and modify() often have DIFFERENT parameter orders/types // CORRECT: Always read the exact signature for the method you're calling // Check references/classes/<ClassName>.md for each method's specific signature ``` **Summary — Before every API call:** 1. **Read the signature** — parameter types, return type, all in `references/classes/` 2. **`await` if `Promise`** — check return type for `Promise<...>` 3. **Use enums** — look up in `references/enums/` instead of guessing numbers/strings 4. **Check remarks** — the "备注" section often has critical usage notes ### Coordinate Unit (CRITICAL) **Different domains use different coordinate units:** | Domain | Unit | Conversion | |--------|------|------------| | **PCB** | 1mil | 1mm ≈ 39.37 units | | **Schematic** | 0.01inch (10mil) | 1mm ≈ 3.937 units | **This is the #1 mistake AI agents make.** Mixing up the units will place components incorrectly. - PCB: 1 unit = 1mil = 0.001 inch = 0.0254 mm - Schematic: 1 unit = 0.01inch = 10mil = 0.254 mm If you use the wrong unit, components will be placed **10x too far** from their intended position. ```javascript // WRONG: thinking unit is 1mil (it's actually 0.01inch = 10mil) // Placing at x=500 thinking it's 500mil = 0.5inch — but 500 units = 5000mil = 5inch! await eda.sch_PrimitiveComponent.create({libraryUuid: "...", uuid: "dev-uuid"}, 500, 0, "", 0, false, true, true); // CORRECT: 50 units = 500mil = 0.5inch (in 0.01inch units) await eda.sch_PrimitiveComponent.create({libraryUuid: "...", uuid: "dev-uuid"}, 50, 0, "", 0, false, true, true); ``` ### Document State (CRITICAL) **After creating a project, you MUST open it before operating on documents within it.** When operating on documents, always verify: 1. **Project is opened** — Use `eda.dmt_Project.getCurrentProjectInfo()` to verify 2. **Correct document is active** — Use `eda.dmt_SelectControl.getCurrentDocumentInfo()` to check document type 3. **Document type matches API domain** — PCB APIs require active PCB document, SCH APIs require active Schematic document ```javascript // WRONG: Assuming operation will work without checking document state await eda.pcb_PrimitiveLine.create(...); // May fail if no PCB document is open // CORRECT: Always verify document state first const project = await eda.dmt_Project.getCurrentProjectInfo(); if (!project) { // If you just created a project, you MUST open it before any operations! return "Error: No project is currently opened. If you just created a project using dmt_Project.createProject(), you MUST call dmt_Project.openProject(projectPath) to open it first. You cannot operate on documents until a project is opened."; } const doc = await eda.dmt_SelectControl.getCurrentDocumentInfo(); if (doc?.documentType !== EDMT_EditorDocumentType.PCB) { return "Error: No PCB document is currently active. Please open a PCB document first."; } // Now safe to perform PCB operations await eda.pcb_PrimitiveLine.create(...); ``` **Operating on the wrong document type will return errors or null results.** For example: - Executing `PCB_*` APIs without an active PCB document (`documentType !== EDMT_EditorDocumentType.PCB`) → error/null - Executing `SCH_*` APIs without an active Schematic document (`documentType !== EDMT_EditorDocumentType.SCHEMATIC_PAGE`) → error/null ### IFrame Context — Always Use `eda` Directly (CRITICAL) When writing extension code that creates an iframe via `sys_IFrame.openIFrame()`, the JavaScript code inside the iframe's HTML can access the `eda` global **directly**. Do NOT use `window.parent.eda`. **Why this matters:** EasyEDA injects the `eda` object into the iframe's execution context automatically. Standard browser cross-frame patterns (`window.parent`, `parentWindow`, etc.) do NOT apply here and will fail. ```javascript // WRONG: Using window.parent to reach parent frame's eda object // This is a common mistake made by AI agents familiar with web iframe patterns const project = await window.parent.eda.dmt_Project.getCurrentProjectInfo(); // CORRECT: eda is available directly in the iframe context const project = await eda.dmt_Project.getCurrentProjectInfo(); ``` **This applies to ALL code inside `sys_IFrame` iframes:** - Extension UI panels loaded via `openIFrame()` - Any HTML file inside the extension package displayed in an iframe **Rule:** In EasyEDA extensions, whether code runs in the main context or inside an iframe created by `sys_IFrame`, always access the API through `eda.xxx` — never through `window.parent.eda` or any other parent frame accessor. ### Multi-Window Support When multiple EasyEDA windows are connected to the bridge, you do NOT need to check window selection on every EDA operation. Only check when: 1. **First EDA operation** — Verify which window is active and tell the user 2. **EDA disconnected error** — If bridge returns an error about EDA being disconnected, ask user to select a new window **Multi-window operations:** ```bash # List all connected EDA windows curl http://localhost:49620/eda-windows # Select a specific window curl -X POST http://localhost:49620/eda-windows/select \ -H "Content-Type: application/json" \ -d '{"windowId": "abc-123-def"}' # Execute on specific window curl -X POST http://localhost:49620/execute \ -H "Content-Type: application/json" \ -d '{"code": "return await eda.dmt_Project.getCurrentProjectInfo();", "windowId": "abc-123-def"}' ``` If only one EDA window is connected, it's automatically selected as active. ## Debugging Tips & Failure Strategies ### Troubleshooting 1. **Always check health first**: Scan ports 49620-49629 for `{"service":"easyeda-bridge"}` 2. **EDA not connected?**: Ensure bridge extension is loaded in EasyEDA. Download: https://ext.lceda.cn/item/oshwhub/run-api-gateway 3. **Timeout errors**: Default 30s timeout. If timeout occurs: - Check if the correct project and document are opened (use `dmt_Project.getCurrentProjectInfo()`) - If no project is opened, use `dmt_Project.openProject(projectPath)` to open one - If no document is active, use `dmt_EditorControl.openDocument(docId)` to open the correct document type (PCB/Schematic) - If the document type is wrong (e.g., running PCB APIs on Schematic), switch to the correct document first - Complex operations may need code splitting 4. **Check return values**: Many methods return `null` on failure — always validate 5. **Layer numbers**: Use enums from `references/enums/` docs (e.g., `EPCB_LayerId`) 6. **EDA window disconnected**: If you get an error about a window being disconnected, use `GET /eda-windows` to check available windows and `POST /eda-windows/select` to switch to another window 7. **Permission errors**: All API interfaces are controlled by EDA's permission system. If a specific API consistently fails to execute (returns error or null) while other APIs work fine, and you've confirmed the call matches the documentation exactly, it may be **blocked by permissions** — not a code bug. The EDA client may restrict certain operations based on user license, project settings, or document state. Inform the user that the operation may require elevated permissions or a different EDA edition. 8. **Persistent errors?**: If you've verified the API call matches the documentation exactly, ruled out permission issues, and still encounter unexpected errors, consider reporting the issue through official EasyEDA support channels ### Failure Handling Rules When developing extensions, follow these rules: | Situation | Action | |-----------|--------| | API method does not exist in docs | **Stop immediately** — inform the user the API doesn't exist | | Signature uncertain after reading docs | **Stop generation** — return to query step and re-read | | Forbidden browser API detected | **Auto-replace** with `eda.sys_*` alternative | | Menu ID conflict | Add prefix to differentiate (e.g., `my-plugin-home`, `my-plugin-sch`) | | Permission blocked | Inform user — may require different EDA edition or license | **Critical:** Never guess an API signature. If `references/classes/` doesn't document it, it doesn't exist for your use case. ## Workflow for AI Agent When the user asks you to perform EDA operations: 1. **Understand the task** — What domain? (PCB/SCH/LIB/Project) 2. **Verify document state** — Check `eda.dmt_Project.getCurrentProjectInfo()` and `eda.dmt_SelectControl.getCurrentDocumentInfo()` 3. **Confirm correct document type** — PCB operations need active PCB, SCH operations need active Schematic 4. **Look up API** — Read relevant class docs from `references/` 5. **Check types** — Read enum/interface docs for parameter types 6. **Write code** — Follow the execution context rules above 7. **Execute** — Send via `POST /execute` and check the result 8. **Iterate** — If errors occur, read error messages and adjust When unsure about an API: - Search `_quick-reference.md` for method names - Read the specific class doc for detailed signatures and remarks - Check interface docs for complex parameter types ## Session Management ### Detecting Topic Changes The Bridge server consumes system resources while running. If the user has switched to a completely different topic (not related to EasyEDA/EDA/PCB/schematic) **3 consecutive times**, proactively ask if they want to close the Bridge: > "I notice we've moved on from EasyEDA. The Bridge server is still running in the background. Would you like me to stop it to free up resources?" **Do NOT close the Bridge automatically** — the user may switch back to EDA work later. Only ask, and close if they confirm. ### Closing the Bridge If the user confirms they want to stop the Bridge: ```bash # Find and stop the bridge process for port in $(seq 49620 49629); do pid=$(lsof -ti :$port 2>/dev/null) if [ -n "$pid" ]; then kill $pid echo "Bridge stopped (PID: $pid, Port: $port)" break fi done ```

path: README.md
content: # EasyEDA API Skill

供 AI 编程工具（Claude Code、OpenCode、QwenCode 等所有支持 [Agent Skills](https://agentskills.io/) 标准的工具）使用的 EasyEDA Pro API 技能包（Skill）。

这个 SKILL 不仅支持 AI 在线调试嘉立创EDA，也支持辅助开发嘉立创EDA扩展。
在开发嘉立创EDA扩展时，AI 可以使用本 SKILL 提供的扩展开发相关文档、API 参考、类型信息、调用示例以及桥接调试能力，帮助完成接口查询、代码编写与联调验证。
如果用户准备自行分析或修改嘉立创EDA文档源码，而不是通过 API 操作，也可以使用本项目提供的文档源码格式说明。

- 📚 **结构化 API 文档** — 自动从参考文档生成分层索引，便于 AI 快速查阅
- 🧾 **文档源码格式规范** — 说明工程、原理图、PCB 文档源码格式，适合直接分析和修改源码的场景
- 🔌 **WebSocket Bridge** — Node.js 服务端，桥接 AI 和 EasyEDA 客户端
- 🤖 **SKILL.md** — 完整的技能指导文件

## 快速开始

### 1. 安装依赖

```bash
npm install
```

### 2. 构建 API 文档

```bash
npm run build:docs
```

这会从 `reference/` 目录读取原始 API 文档，生成结构化文档到 `docs/` 目录。

### 3. 启动 WebSocket Bridge 服务器

```bash
npm run server
```

服务器自动在端口范围 `49620-49629` 中选择可用端口启动，等待 EasyEDA 客户端连接。

### 4. EasyEDA 端连接

在嘉立创EDA中安装 `run-api-gateway.eext` 扩展，下载地址：

- https://ext.lceda.cn/item/oshwhub/run-api-gateway

扩展加载后会自动连接到 Bridge 服务器（自动扫描端口范围，验证握手后连接）。

### 5. 使用 AI 编程工具

AI 编程工具（Claude Code、OpenCode、QwenCode 等）会自动读取 `SKILL.md` 获取技能指导，通过 HTTP API 向 EDA 发送代码：

```bash
# 检查 EDA 连接状态（端口自动发现，此处假设服务在 49620）
curl http://localhost:49620/health

# 执行 EDA 代码
curl -X POST http://localhost:49620/execute \
  -H "Content-Type: application/json" \
  -d '{"code": "return await eda.dmt_Project.getCurrentProjectInfo();"}'
```

## 一键打包

```bash
npm run pack
```

这会执行以下步骤：
1. 构建 API 文档（`docs/`）
2. 将 SKILL.md、文档、服务器打包到 `dist/easyeda-api/`
3. 生成 `dist/easyeda-api.zip` 用于上传

如果文档已构建好，可跳过构建步骤：

```bash
npm run pack:fast
```

### 发布到 ClawHub

```bash
npx clawhub@latest publish dist/easyeda-api/
```

或上传 zip 文件到 https://clawhub.ai/upload

## 架构

```
┌──────────────┐   HTTP/WS     ┌────────────────┐   WebSocket    ┌──────────┐
│   AI Agent    │ ◄───────────► │  Bridge Server  │ ◄───────────► │  EasyEDA  │
│  (Skill Tool) │  Port Range   │  (Node.js)      │  Port Range   │  (Client) │
└──────────────┘  49620-49629   └────────────────┘  49620-49629   └──────────┘
```

## 通信协议

| 消息类型 | 方向 | 说明 |
|----------|------|------|
| `execute` | AI → EDA | 执行 JS 代码 |
| `result` | EDA → AI | 返回执行结果 |
| `error` | EDA → AI | 返回执行错误 |
| `handshake` | Server → Client | 连接验证（含 `service: "easyeda-bridge"`） |
| `ping/pong` | 双向 | 心跳检测 |

## 目录结构

```
easyeda-api-skill/
  SKILL.md              # AgentSkills 标准技能定义
  AGENTS.md              # Agent 提示指南
  package.json          # 项目配置
  reference/            # 原始 API 参考文档（gitignore）
  docs/                 # 构建后的结构化文档（gitignore）
  format/               # 嘉立创EDA文档源码格式规范（project/schematic/pcb）
  guide/                # API 开发指南（人工撰写）
  user-guide/           # 用户指南（人工撰写）
  server/index.mjs      # WebSocket Bridge 服务器
  scripts/
    build-docs.mjs      # 文档构建脚本
    pack.mjs            # 打包脚本
  dist/                 # 打包输出（gitignore）
    easyeda-api/        # 可发布的 skill 目录
    easyeda-api.zip     # 用于 ClawHub 上传的 zip 文件
```


path: format/index.md
content: # 嘉立创EDA文件格式

## V2.2版本的文件格式

V2.2版本的文件格式：[lceda-pro-file-format-v2.2_2022.12.15.zip](https://image.lceda.cn/files/lceda-pro-file-format-v2.2_2022.12.15.zip)

提示：这不是最新的文件格式规范，但这里有绝大部分的格式细节。

## V3版本的文件格式

V3版本使用全新的源码格式，完全不同于之前的格式。

提示：嘉立创EDA 3.0 全面改造了工程格式，使用日志的概念对工程变更进行了增量存储；并且从 2.0 的按照数组偏移量的设计风格，调整成了按照 key-value 的风格，便于后期格式演进，和相关兼容代码的开发，以及提高可读性。

V3版本的文件格式（zip里面包含范例文件）：
- [lceda-pro-file-format-v3_2025.10.21.zip](https://image.lceda.cn/files/lceda-pro-file-format-v3_2025.10.21.zip)
- [lceda-pro-file-format-v3_2025.10.21.md](https://image.lceda.cn/files/lceda-pro-file-format-v3_2025.10.21.md)
- [lceda-pro-file-format-v3_2025.10.21.pdf](https://image.lceda.cn/files/lceda-pro-file-format-v3_2025.10.21.pdf)

### 格式详情文档

- [工程格式](/cn/format/project/index.md)
- [原理图格式](/cn/format/schematic/index.md)
- [PCB格式](/cn/format/pcb/index.md)

### 基础文档格式

#### 文档约定

-   工程的所有数据存在一个日志文档里，日志记录变动的首行必须是文件头 `DOCTYPE`，以区分不同类型文档， `DOCTYPE`作为一个 `块级元素`存在于工程日志中
-   以行为单位，每一行都是由两个合法的 JSON 对象拼接而成，第一个对象是用于最终一致性框架解析使用，后一个是 `原子结构对象`
-   键名采用驼峰命名，每个单词的首字母大写（除了第一个单词的首字母外），并且单词之间没有下划线或其他分隔符
-   所有图元都要带上文件内的 `唯一编号`
-   `旋转角度` 以逆时针方向为正，统一使用角度制
-   若无特殊说明，所有坐标、长度、大小统一使用 `0.01 inch` 为单位
-   所有颜色都使用 `"#RRGGBB"` 的方式表达，如果需要表示无颜色（完全透明），则用 `""`
-   所有使用 `是否XXXX` 描述的属性，都使用 `1` 是 `0` 否 的编码方式
-   本 `约定` 中未明确描述的部分（如转义等），全部依据 [RFC 7195 The JavaScript Object Notation (JSON) Data Interchange Format](https://tools.ietf.org/html/rfc7159)

#### 文档头

-   所有数据的开头必须带上文档头，以区分不同类型文档
-   逐行解析时，当解析遇到文档头时，表示接下来解析的数据都归到该文档下，直到遇到下一个文档头

```json
{ "type": "DOCHEAD" }||{ "docType": "SCH_PAGE", "uuid": "UUID", "client": "clientID" }|
```

1. type："DOCHEAD"，文档头标识
2. docType：文档类型
3. uuid：文档唯一编号，工程内唯一
4. client：最终一致性的一个终端标识

###### docType 文档类型

-   工程配置 `PROJECT_CONFIG`
-   板子 `BOARD`
-   原理图 `SCH`
-   原理图页 `SCH_PAGE`
-   PCB `PCB`
-   面板 `PANEL`
-   符号 `SYMBOL`
-   封装 `FOOTPRINT`
-   器件 `DEVICE`
-   真彩图 `BLOB`
-   实例属性 `INSTANCE`

#### 数据格式

```json
{ "type": "TYPE", "id": "UUID", "ticket": 1}||{["key": string]: any}|
```

通过标识符`||`, 将一条数据分割成内外两层数据：

1. 外层数据：用于最终一致性框架使用，保证数据的一致性
    1. type 数据类型
    2. id 唯一编号，需保证在文档内具体的 type 下唯一
    3. ticket 逻辑时钟，仅用于最终一致性框架，保证数据的唯一
2. 内层数据: 图元原子数据，是一个`key-value`对象，具体的数据内容详见各类型对应的文档

之所以分为内外两层数据，是因为在最终一致性框架中，无需关注具体的图元数据，只需要外层数据就能保证数据的唯一，以减少不必要的 JSON 解析，节省内存消耗

```json
{ "type": "META", "ticket": 1}||{"name": "名称"}|
```

有一些数据是在文档内就只能保留一个数据，用 type 字段就能表示唯一，会省略掉 id 字段，只有同一类型下有多个数据时才用 id 字段去区分

#### 最终一致性

-   存储 3.0，数据增删改都是往日志里加一条数据，这样日志里存在多条数据是表示的是同一个数据
-   最终一致性框架根据 type、id、ticket 字段决定保留哪一条数据，保证数据的一致性

ps: 更加详细的描述请查看最终一致性的设计文档，这里仅说明相关字段的用处

###### type 相同且 id 相同的两条数据

```json
{ "type": "TYPE", "id": "UUID", "ticket": 1}||{"data": 1}|
```

```json
{ "type": "TYPE", "id": "UUID", "ticket": 2}||{"data": 2}|
```

最终一致性框架，就会去对比 ticket 字段，ticket 更大的则保留下来，ticket 小的则舍弃，上面 data 为 2 的数据则保留

###### type 相同且 id 相同，ticket 也相同

```json
{ "type": "DOCHEAD" }||{ "docType": "SCH_PAGE", "uuid": "UUID", "client": "1" }|
{ "type": "TYPE", "id": "UUID", "ticket": 1}||{"data": 1}|
```

```json
{ "type": "DOCHEAD" }||{ "docType": "SCH_PAGE", "uuid": "UUID", "client": "2" }|
{ "type": "TYPE", "id": "UUID", "ticket": 1}||{"data": 2}|
```

则去比较文档头的 client 字段，client 标识更小的则保留下来，上面 data 为 1 的数据则保留

#### 删除

##### 原子数据删除

```json
{ "type": "TYPE", "id": "UUID", "ticket": 1}||""
```

数据的删除实际就是将内层数据置为空字符串

##### 文档删除

```json
{ "type": "DELETE_DOC", "ticket": 1}||{"isDelete": true}|
```

1. type `DELETE_DOC` 文档删除标识
2. isDelete 是否删除

-   文档删除实际是添加一个删除的标识，并不会在日志内直接删除文档数据，以方便文档删除的撤销和数据的一致性维护

-   所有删除的数据都会在日志里有所保留，用户如果要去除工程内删除的数据记录，让用户走克隆工程以去除这些数据，日志的快照不会去清除相关删除的记录


path: format/pcb/3d.md
content: # 3D 外壳体系

## SHELL 外壳

```json
{ "type": "SHELL", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":0.223,
  "shellType":"T&B",
  "shellHeight":50,
  "pcbHeight":100,
  "strokeWidth":10,
  "path":"复杂多边形",
  "attrs":{},
}|
```

1. type 外壳 `SHELL`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. shellType 外壳类型
    - `T&B` 上下壳
    - `DRAWER` 推盖
    - `CLAM` 翻盖
9. shellHeight 外壳高度
10. pcbHeight PCB 高度
11. strokeWidth \*线宽（弃用）
12. path 参考复杂多边形
13. attrs 自定义属性：3D 外壳每种类型都有一组自定义的外壳属性
    - T&B
        - Thickness：外壳厚度
        - BottomHeight：下壳高度
        - TopInnerHeight：上壳内壁高度
        - TopInnerThickness：上壳内壁厚度
    - DRAWER
        - Thickness：外壳厚度
        - Direction：推盖方向
            - `1` X 轴正向
            - `2` X 轴负向
            - `4` Y 轴正向
            - `8` Y 轴负向

## CREASE 侧面基准线（折痕）

`CREASE` 折痕图元需要配合 `CONNECT` 关联 `SHELL_ENTITY` `BOSS`，以表达外壳挖槽

```json
{ "type": "CREASE", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":8.275,
  "layerId":49,
  "startX":20,
  "startY":30,
  "endX":40,
  "endY":50,
  "angle":90,
}|
```

1. type 折痕 `CREASE`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. layerId 层编号
9. startX 起始 X
10. startY 起始 Y
11. endX 结束 X
12. endY 结束 Y
13. angle 折叠角度

## SHELL_ENTITY 外壳实体区域

没有通过 `CONNECT` 与 `CREASE` 关联的 `SHELL_ENTITY`，则垂直进行顶层、底层外壳的填充/裁剪（挖槽）

```json
{ "type": "SHELL_ENTITY", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":0.15,
  "layerId":50,
  "booleanOperation":0,
  "belong":0,
  "depth":10,
  "strokeWidth":10,
  "path":"复杂多边形",
}|
```

1. type 外壳实体区域 `SHELL_ENTITY`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. layerId 层编号
9. booleanOperation 布尔操作：0 裁剪 1 填充
10. belong 隶属：0 自动 1 上壳 2 下壳 4 外壳边框 8 螺丝柱 16 实体，可通过加法组合
    - 上下壳：3 = 1 + 2
    - 外壳边框 + 螺丝柱：12 = 4 + 8
    - 螺丝柱 + 实体：24 = 8 + 16
    - 外壳边框 + 螺丝柱 + 实体：28 = 4 + 8 + 16
11. depth 深度
12. strokeWidth 线宽
13. path 参考复杂多边形

## BOSS 螺丝柱

通过 `CONNECT` 与 `CREASE` 关联的 `BOSS`，添加的是侧方的螺丝柱

```json
{ "type": "BOSS", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":0.8976,
  "layerId":50,
  "centerX":100,
  "centerY":200,
  "specification":"M2",
  "depth":100,
  "thickness":10,
  "holeDiameter":20,
  "counterBore":[100, 20],
  "stiffener":[20, 40, 20, 10],
}|
```

1. type 螺丝柱 `BOSS`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. layerId 层编号
9. centerX 中心 X
10. centerY 中心 Y
11. specification 螺丝型号：`"M2"` `"M3"` 等，或者 `null` 表示自定义
12. depth 螺丝柱高度
13. thickness 螺丝柱壁厚
14. holeDiameter 螺丝柱通孔直径
15. counterBore 沉头所需参数，当此参数为 `null` 时表示不需要沉头
    - 螺丝头高度
    - 螺丝头直径
16. stiffener 加强筋所需参数，当此参数为 `null` 时表示不需要加强筋
    - 加强筋上端宽度
    - 加强筋下端宽度
    - 加强筋距螺丝柱上端距离
    - 加强筋厚度


path: format/pcb/attr.md
content: # ATTR 属性

属性用以描述 PCB 或者 FOOTPRINT 有可能需要在图上显示的属性

```json
{ "type": "ATTR", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":0.072,
  "parentId":"",
  "layerId":1,
  "positionX":200,
  "positionY":150,
  "key":"DESIGNATOR",
  "value":"U1",
  "keyVisible":0,
  "valueVisible":1,
  "fontFamily":"宋体",
  "fontSize":50,
  "strokeWidth":10,
  "bold":0,
  "italic":0,
  "origin":5,
  "angle":15,
  "reverse":1,
  "reverseExpansion":0,
  "mirror":1,
  "width":100,
  "height":200,
  "path":["复杂多边形"],
}|
```

1. type 属性 `ATTR`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. parentId 隶属编号，留空表示当前块级图元
9. layerId 层
10. positionX 位置 X：未显示过的属性位置固定为 null
11. positionY 位置 Y：未显示过的属性位置固定为 null
12. key Key
13. value Value
14. keyVisible 是否显示 Key
15. valueVisible 是否显示 Value
16. fontFamily 字体名称
17. fontSize 字号
18. strokeWidth 粗细
19. bold 是否加粗
20. italic 是否斜体
21. origin 对齐模式 `0` 左顶 `1` 中顶 `2` 右顶 `3` 左中 `4` 中中 `5` 右中 `6` 左底 `7` 中底 `8` 右底
22. angle 旋转角度
23. reverse 是否反相扩展
24. reverseExpansion 反相扩展尺寸：反相扩展区域的尺寸，支持负数
25. mirror 是否镜像，一般来说，当一个文字出现在底层，这里也需要相应调整成 `1`
26. width 高，没有则为 null
27. height 宽，没有则为 null
28. path 复杂多边形数组，没有则为 null


path: format/pcb/common.md
content: # 通用格式

## 文档头

```json
{ "type": "DOCHEAD" }||{ "docType": "PCB", "uuid": "UUID", "client": "clientID" }|
```

```json
{ "type": "DOCHEAD" }||{ "docType": "FOOTPRINT", "uuid": "UUID", "client": "clientID" }|
```

-   type："DOCHEAD"，文档头标识
-   docType：文档类型，"PCB" PCB, "FOOTPRINT" 封装
-   uuid：文档唯一编号，工程内唯一
-   client：最终一致性的一个终端标识

## CANVAS 画布配置

```json
{ "type": "CANVAS", "ticket": 1 }||
{
  "originX":0,
  "originY":0,
  "unit":"mm",
  "gridXSize":10,
  "gridYSize":10,
  "snapXSize":1,
  "snapYSize":1,
  "altSnapXSize":0.1,
  "altSnapYSize":0.1,
  "gridType":1,
  "multiGridType":0,
  "multiGridRatio":5,
}|
```

1. type 画布配置 `CANVAS`
2. ticket 逻辑时钟
3. originX 画布原点 X
4. originY 画布原点 Y
5. unit **显示**单位（不会影响格式里数据的单位）
6. gridXSize 网格尺寸 X
7. gridYSize 网格尺寸 Y
8. snapXSize 栅格尺寸 X
9. snapYSize 栅格尺寸 Y
10. altSnapXSize Alt 栅格尺寸 X
11. altSnapYSize Alt 栅格尺寸 Y
12. gridType 网格类型：`0` 无 `1` 网格 `2` 网点
13. multiGridType 加粗网格类型：`0` 无 `1` 网格 `2` 网点
14. multiGridRatio 加粗网格倍数：number

## LAYER 层配置

-   所有 `SIGNAL` `PLANE` `SUBSTRATE` 出现的顺序隐含了它的物理堆叠顺序
-   所有 `SIGNAL` `PLANE` `SUBSTRATE` 数量不受限制
-   格式不假设层编号与层维持稳定的关系，具体实现由工具决定

```json
{ "type": "LAYER","id": 0, "ticket": 1 }||
{
  "layerType":"TOP",
  "layerName":"Top Layer",
  "status":1,
  "activeColor":"#FF0000",
  "activateTransparency":0.5,
  "inactiveColor":"#880000",
  "inactiveTransparency":0.3,
}|
```

1. type 层 `LAYER`
2. id 层编号：唯一
3. ticket 逻辑时钟
4. layerType 层类型
5. layerName 层别名，需要唯一
6. status 状态：`1` 使用 `2` 显示 `4` 锁定，可通过相加叠加状态，例如
    - 使用并显示 3 = 1 + 2
    - 使用并锁定但不显示 5 = 1 + 4
    - 使用并显示并锁定 7 = 1 + 2 + 4
7. activeColor 激活颜色
8. activateTransparency 激活透明度
9. inactiveColor 非激活颜色
10. inactiveTransparency 非激活透明度

```json
["LAYER",2,"BOTTOM","Bottom Layer",1,"#0000ff",1,"#00007f",1]
["LAYER",3,"TOP_SILK","Top Silkscreen Layer",1,"#ffcc00",1,"#7f6600",1]
["LAYER",4,"BOT_SILK","Bottom Silkscreen Layer",1,"#66cc33",1,"#336619",1]
["LAYER",5,"TOP_SOLDER_MASK","Top Solder Mask Layer",1,"#800080",1,"#400040",1]
["LAYER",6,"BOT_SOLDER_MASK","Bottom Solder Mask Layer",1,"#aa00ff",1,"#55007f",1]
["LAYER",7,"TOP_PASTE_MASK","Top Paste Mask Layer",1,"#808080",1,"#404040",1]
["LAYER",8,"BOT_PASTE_MASK","Bottom Paste Mask Layer",1,"#800000",1,"#400000",1]
["LAYER",9,"TOP_ASSEMBLY","Top Assembly Layer",1,"#33cc99",1,"#19664c",1]
["LAYER",10,"BOT_ASSEMBLY","Bottom Assembly Layer",1,"#5555ff",1,"#2a2a7f",1]
["LAYER",11,"OUTLINE","Board Outline Layer",1,"#ff00ff",1,"#7f007f",1]
["LAYER",12,"MULTI","Multi-Layer",1,"#c0c0c0",1,"#606060",1]
["LAYER",13,"DOCUMENT","Document Layer",1,"#ffffff",1,"#7f7f7f",1]
["LAYER",14,"MECHANICAL","Mechanical Layer",1,"#f022f0",1,"#781178",1]
["LAYER",50,"SUBSTRATE","Dialectric1",3,"#999966",1,"#4c4c33",1]
["LAYER",15,"SIGNAL","Inner1",3,"#999966",1,"#4c4c33",1]
["LAYER",52,"SUBSTRATE","Dialectric3",3,"#999966",1,"#4c4c33",1]
["LAYER",51,"SUBSTRATE","Dialectric2",3,"#999966",1,"#4c4c33",1]
["LAYER",17,"SIGNAL","Inner2",3,"#008000",1,"#004000",1]
["LAYER",58,"SUBSTRATE","Dialectric9",3,"#999966",1,"#4c4c33",1]
["LAYER",16,"SIGNAL","Inner3",3,"#00ff00",1,"#007f00",1]
["LAYER",53,"SUBSTRATE","Dialectric4",3,"#999966",1,"#4c4c33",1]
["LAYER",47,"HOLE","Hole Layer",1,"#222222",1,"#111111",1]
["LAYER",48,"SHELL","3D Shell Layer",1,"#222222",1,"#111111",1]
["LAYER",49,"TOP_SHELL","Top 3D Shell Layer",1,"#222222",1,"#111111",1]
["LAYER",50,"BOT_SHELL","Bottom 3D Shell Layer",1,"#222222",1,"#111111",1]
```

## LAYER_PHYS 层物理特性配置

```json
{ "type": "LAYER_PHYS","id": 0, "ticket": 1 }||
{
  "material":"COPPER",
  "thickness":1,
  "permittivity":0,
  "lossTangent":0,
  "isKeepIsland":0,
}|
```

1. type 层物理特性 `LAYER_PHYS`
2. id 层编号
3. ticket 逻辑时钟
4. material 层材质
5. thickness 厚度
6. permittivity 介电常数
7. lossTangent 损耗切线
8. isKeepIsland 内电层是否保留孤岛

```json
{ "type": "LAYER_PHYS","id": 2, "ticket": 1 }||
{
  "material":"COPPER",
  "thickness":1,
  "permittivity":0,
  "lossTangent":0,
  "isKeepIsland":0,
}|
```

```json
{ "type": "LAYER_PHYS","id": 15, "ticket": 1 }||
{
  "material":"COPPER",
  "thickness":1,
  "permittivity":0,
  "lossTangent":0,
  "isKeepIsland":1,
}|
```

```json
{ "type": "LAYER_PHYS","id": 50, "ticket": 1 }||
{
  "material":"COPPER",
  "thickness":10,
  "permittivity":4.5,
  "lossTangent":0.02,
  "isKeepIsland":0,
}|
```

## ACTIVE_LAYER 配置当前激活层

```json
{ "type": "ACTIVE_LAYER", "ticket": 1 }||
{
  "layerId":0,
}|
```

1. type 当前激活层 `ACTIVE_LAYER`
2. ticket 逻辑时钟
3. layerId 层序号

## SILK_OPTS 丝印配置

丝印配置目前主要用于彩色丝印工艺

```json
{ "type": "SILK_OPTS","id": 3, "ticket": 1 }||
{
  "defaultColor":"#ffffff",
  "baseColor":"#000000",
}|
```

1. type 丝印配置：SILK_OPTS
2. id 层编号，层：只有 顶层丝印 与 底层丝印
3. ticket 逻辑时钟
4. defaultColor 默认颜色
5. baseColor 底色

```json
{ "type": "SILK_OPTS","id": 4, "ticket": 1 }||
{
  "defaultColor":"#020202",
  "baseColor":"#aaaaaa",
}|
```

## PREFERENCE 偏好

```json
{ "type": "PREFERENCE", "ticket": 1 }||
{
  "startTrackWidthFollowLast":0,
  "lastTrackWidth":10,
  "startViaSizeFollowLast":0,
  "lastViaInnerDiameter":39.37,
  "lastViaDiameter":78.74,
  "snap":1,
  "routingMode":2,
  "routingCorner":"L45",
  "removeLoop":1,
  "rotatingObject":0,
  "trackFollow":0,
  "stretchTrackMinCorner":1,
  "preferenceConfig":null,
  "realTimeUpdateUnusedLayers":0,
  "unusedPadRange":3,
  "pushVia":"OPTIMIZA_OPEN",
  "pathOptimization4BePushed":0,
  [REDACTED_SECRET]:"OPTIMIZA_WEAK",
  "removeCircuitsContainingVias":1,
  "removeAntenna":1,
}|
```

1. type 偏好 `PREFERENCE`
2. ticket 逻辑时钟
3. startTrackWidthFollowLast 起始布线是否跟随上次设置
4. lastTrackWidth 上次布线宽度
5. startViaSizeFollowLast 起始打孔尺寸是否跟随上次设置
6. lastViaInnerDiameter 上次打孔内径
7. lastViaDiameter 上次打孔外径
8. snap 是否自动吸附
9. routingMode 布线模式：`0` 无 `1` 推挤 `2` 环绕 `3` 阻挡
10. routingCorner 布线拐角模式
    - `"L45"` 线条 45 度
    - `"L90"` 线条 90 度
    - `"R45"` 圆弧 45 度
    - `"R90"` 圆弧 90 度
    - `"L"` 线条自由角度
    - `"R"` 圆弧自由角度
11. removeLoop 布线是否自动移除回路
12. rotatingObject 是否单对象旋转
13. trackFollow 导线是否跟随封装移动
14. stretchTrackMinCorner 拉伸导线最小拐角比率（比线宽）
15. preferenceConfig 层堆叠偏好来源
16. realTimeUpdateUnusedLayers 是否自动移除未使用焊盘
17. unusedPadRange 移除未使用焊盘的范围
    1. 全部
    2. 仅焊盘
    3. 仅过孔
18. pushVia 推挤过孔
19. pathOptimization4BePushed 路径优化（单段/整段）
20. currentPathOptimization4BePushed 当前导线路径优化
21. removeCircuitsContainingVias 是否移除有过孔的回路
22. removeAntenna 是否移除天线

## ITEM_ORDER 图元顺序建议

提供给 PCB 图元顺序建议，PCB 可以依照这个信息安排图元顺序，这个信息只能出现一次

```json
{ "type": "ITEM_ORDER",  "ticket": 1 }||{ "ids":["e2", "e1"] }|
```

1. type 图元顺序建议：ITEM_ORDER
2. ticket 逻辑时钟
3. ids 图元编号：有两种编码形式
    1. 普通编号：形式为 `/^[a-z]+\d+$/i`，如 `e1` `e123` 等
    2. 封装实例编号：形式为 `/^[a-z]+\d+[a-z]+\d+$/i`，用于如封装中的丝印等，如 `e1e5` `e12e22` 等

这里说明下为什么叫做 “建议”，因为比如 `e1` 是顶层图元，`e2` 是底层图元，那么

```json
{ "type": "ITEM_ORDER",  "ticket": 1 }||{ "ids":["e2", "e1"] }|
```

默认依然是 `e1` 在上面，除非有什么特殊操作导致底层置顶了


path: format/pcb/component.md
content: # 封装体系

PCB 的封装采用 Master/Instance 模式，通过覆盖规则去描述封装，以最低冗余的方式去描述

## COMPONENT 器件实例

实例里只存在属性，同 `Key` 属性将以实例的代替 `FOOTPRINT` 的

```json
{ "type": "COMPONENT", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":0.22,
  "layerId":1,
  "positionX":150,
  "positionY":200,
  "angle":45,
  "attrs":{ "3D Model": "uuid", "3D Model Transform": "20,10,0,0,15,45,0,0,20" },
}|
```

1. type 实例 `COMPONENT`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. layerId 层（只有顶层底层）
9. positionX 位置 X
10. positionY 位置 Y
11. angle 旋转角度
12. attrs 自定义属性
    - 固定 `3D Model` 为 3D 模型的 uuid，此 uuid 代表 components 表中 doctype = 16 的一条记录
    - 固定 `3D Model Transform` 为 3D 模型变换参数

```json
["ATTR", "e102", 0, "e8", 1, "Designator", "U1", 0, 1, "宋体", 50, 10, 0, 0, 0, 1, 2, 15, 1, 1]
```

```json
["ATTR", "e103", 0, "e8", 1, "Footprint", "footprint-uuid", 0, 1, "宋体", 50, 10, 0, 0, 0, 1, 2, 15, 1, 1]
```

```json
["ATTR", "e104", 0, "e8", 1, "Device", "device-uuid", 0, 1, "宋体", 50, 10, 0, 0, 0, 1, 2, 15, 1, 1]
```

#### 焊盘实例网络映射 `PAD_NET`

```json
{ "type": "PAD_NET", "id":"COMPONENT_UUID", "ticket": 1 }||
{
  "padNum":"a1",
  "padNet":"GND",
  "padId":"e125",
}|
```

1. type 焊盘实例网络映射 `PAD_NET`
2. id 所属器件实例编号
3. ticket 逻辑时钟
4. padNum 焊盘编号
5. padNet 网络名
6. padId 封装内焊盘 ID（可选）

#### 复用图块信息 `REUSE_BLOCK`

```json
{ "type": "REUSE_BLOCK", "id":"COMPONENT_UUID", "ticket": 1 }||
{
  "groupId":"$1e16",
  "channelId":"$2e5_$4e3",
}|
```

1. type 复用图块信息 `REUSE_BLOCK`
2. id 所属器件实例编号
3. groupId 分组 ID
4. channelId 通道 ID

#### 3D Model Transform 的特殊说明

```json
{ "type": "COMPONENT", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":0.22,
  "layerId":1,
  "positionX":150,
  "positionY":200,
  "angle":45,
  "attrs":{ "3D Model": "uuid", "3D Model Transform": "20,10,0,0,15,45,0,0,20" },
}|
```

在器件中，固定 `3D Model Transform` 为 3D 模型为匹配此器件【在顶层】【坐标 0,0】【旋转角度 0】时所需要的变换参数

其参数为

1. sizeX：X 轴尺寸
2. sizeY：Y 轴尺寸
3. sizeZ：Z 轴尺寸，这里有个兼容性处理，如果为 0，则自动适应高度
4. rotZ：绕 Z 轴旋转角度
5. rotX：绕 X 轴旋转角度
6. rotY：绕 Y 轴旋转角度
7. offX：X 轴偏移量
8. offY：Y 轴偏移量
9. offZ：Z 轴偏移量

通过 3D 模型变换参数，生成 3D 模型变换矩阵的算法如下

```python
cx = 3D 模型 X 轴中点
cy = 3D 模型 Y 轴中点
bz = 3D 模型 最低 Z 值

wx = 3D 模型 X 轴宽度
wy = 3D 模型 Y 轴宽度
wz = 3D 模型 Z 轴宽度

ORIGIN = translate(-cx, -cy, -bz)
SCALE = scale(sizeX / wx, sizeY / wy, sizeZ / wz)
ROT = rotateZXY(rotZ, rotX, rotY)
OFFSET = translate(offX, offY, offZ)

MATRIX = OFFSET X ROT X SCALE X ORIGIN
```


path: format/pcb/dimension.md
content: # DIMENSION 尺寸工具集

```json
{ "type": "DIMENSION", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":2.221,
  "type":"RADIUS",
  "layerId":3,
  "unit":"mm",
  "strokeWidth":0.5,
  "precision":3,
  "textFollow":1,
  "coords": [100 200 300 400 400 400],
}|
["DIMENSION", "e101", 0, 1, 2.221, "RADIUS", 3, "mm", 0.5, 3, 1, [100 200 300 400 400 400]]
```

1. type 尺寸工具 `DIMENSION`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. type 尺寸类型： `RADIUS` 半径 `LENGTH` 长度 `ANGLE` 角度
9. layerId 层
10. unit 单位 `mm` `cm` `inch` `mil`
11. strokeWidth 线宽
12. precision 精度
13. textFollow 文字是否跟随：`1` 工具自动决定文字的位置 `0` 永远采用 `ATTR` 的位置
14. coords 坐标集 X1 Y1 X2 Y2 X3 Y3 ... 不同尺寸类型对坐标有不同的定义

```json
["ATTR", "e102", 0, "e101", 1, 200, 150, "VALUE", "1234mm", 0, 1, "宋体", 50, 10, 0, 0, 0, 2, 15, 1, 1]
```

`DIMENSION` 需要附带一个 Key 为 `VALUE` 的属性，表达尺寸工具的文字部分，EDA 需要忽略其不需要的属性，例如 `是否显示 Key` `是否显示 Value`

### RADIUS 半径工具

坐标集第一个坐标为和 ARC 接触的端点，最后一个坐标为默认显示文字的端点，如下图

![图片](/storage/images/cn/format/pcb/dimension/dim_radius.png)

### LENGTH 长度工具

坐标集只需要具有四个点，分别如下图

![图片](/storage/images/cn/format/pcb/dimension/dim_length.png)

### ANGLE 角度工具

坐标集需要 3 个点，分别如下图

![图片](/storage/images/cn/format/pcb/dimension/dim_angle.png)


path: format/pcb/index.md
content: # PCB 格式文档

本章节详细介绍了嘉立创EDA PCB文件的格式规范。PCB文件主要包含以下几个部分：

- [通用格式](/cn/format/pcb/common.md)：文档头、画布、层、物理层、偏好等。
- [分区格式](/cn/format/pcb/partition.md)：分区定义。
- [基础图元](/cn/format/pcb/primitive.md)：网络、图元配置、分组、丝印配置、关联、属性等。
- [焊盘与过孔](/cn/format/pcb/pad_via.md)：焊盘和过孔。
- [形状图元](/cn/format/pcb/shape.md)：直线、圆弧、多边形体系、折线、填充、区域、覆铜、图片、泪滴等。
- [二进制对象](/cn/format/pcb/obj.md)：内嵌对象。
- [3D 外壳](/cn/format/pcb/3d.md)：外壳、折痕、实体、螺丝柱。
- [文字体系](/cn/format/pcb/text.md)：文字。
- [属性](/cn/format/pcb/attr.md)：属性。
- [尺寸工具](/cn/format/pcb/dimension.md)：尺寸标注。
- [封装体系](/cn/format/pcb/component.md)：元件实例。
- [设计规则](/cn/format/pcb/rule.md)：规则模板、规则定义、规则选择器。
- [拼版](/cn/format/pcb/panel.md)：拼版参数。


path: format/pcb/obj.md
content: # OBJ 二进制内嵌对象

将文件等数据编码到如下图元，以内嵌于图页上的图片和文件，可作为附件下载，以及直接显示

```json
{ "type": "OBJ", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":5.286,
  "layerId":15,
  "fileName":"a.png",
  "startX":200,
  "startY":300,
  "width":10,
  "height":20,
  "angle":0,
  "mirror":1,
  "path":"blob:1234ade2f",
}|
["OBJ", "e662", 0, 1, 5.286, 15, "a.png", 200, 300, 10, 20, 0, 1, "blob:1234ade2f"]
```

1. type 二进制内嵌对象标识：OBJ
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. layerId 层
9. fileName 文件名
10. startX 左上 X
11. startY 左上 Y
12. width 宽
13. height 高
14. angle 旋转角度，绕 `左上` 点
15. mirror 原始图片是否水平镜像，镜像以原始图片 BBox 中点进行水平镜像
16. path 二进制数据
    1. 一般格式，与 `Data Urls` 完全兼容 `data:[<mediatype>][;base64],<data>`
        - 如 `data:image/png;base64,asdfasdfwer`
    1. BLOB 引用格式 `blob:hashid`


path: format/pcb/pad_via.md
content: # 焊盘与过孔

## VIA 过孔

过孔一般用于打通不同层之间的电路
对于多层板一般有如下几种模式
通孔：`开始层` 到 `结束层` 贯穿顶层底层
盲孔：`开始层` 或 `结束层` 只有一个属于顶层或底层
埋孔：`开始层` 和 `结束层` 都不属于顶层或底层

```json
{ "type": "VIA", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":3.223,
  "netName":"GND",
  "ruleName":"asdf",
  "centerX":100,
  "centerY":200,
  "holeDiameter":5,
  "viaDiameter":9,
  "viaType":0,
  "topSolderExpansion":null,
  "bottomSolderExpansion":null,
  "unusedInnerLayers":[17],
}|
```

1. type 过孔 `VIA`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. netName NET
9. ruleName 过孔层类型：设计规则名称，定义过孔的开始层结束层
10. centerX 坐标 X
11. centerY 坐标 Y
12. holeDiameter 孔直径
13. viaDiameter 焊盘直径
14. viaType 过孔类型：0 普通过孔 1 缝合孔
15. topSolderExpansion 顶层阻焊扩展：`null` 为遵循规则
16. bottomSolderExpansion 底层阻焊扩展：`null` 为遵循规则
17. unusedInnerLayers 隐藏焊盘层（可选）：被隐藏焊盘的层数组

## PAD 焊盘

焊盘一般用于元器件与电路板焊接
焊盘要么贯穿整个电路板，要么只在顶层或者底层，所以只有顶层、底层、多层三种层

```json
{ "type": "PAD", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":6.234,
  "netName":"GND",
  "layerId":0,
  "num":"1",
  "centerX":100,
  "centerY":200,
  "padAngle":15,
  "hole":["参考孔"],
  "defaultPad":["参考焊盘"],
  "specialPad":[[0, 1, ["参考焊盘"]]],
  "padOffsetX":10,
  "padOffsetY":-5,
  "relativeAngle":30,
  "plated":1,
  "padType":null,
  "topSolderExpansion":0.5,
  "bottomSolderExpansion":0.4,
  "topPasteExpansion":null,
  "bottomPasteExpansion":0,
  "connectMode":0,
  "spokeSpace":10,
  "spokeWidth":5,
  "spokeAngle":45,
  "unusedInnerLayers":[15, 17],
}|
```

1. type 焊盘 `PAD`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. netName 网络
9. layerId 层（只有顶层、底层、多层）
10. num 焊盘编号
11. centerX 焊盘原点 X
12. centerY 焊盘原点 Y
13. padAngle 焊盘旋转角度
14. hole 孔：参考孔，`null` 表示无孔
15. defaultPad 默认焊盘：参考焊盘
16. specialPad 特殊焊盘（多组，每组定义如下）
    1. 开始层
    2. 结束层
    3. 参考焊盘
17. padOffsetX 孔偏移 X
18. padOffsetY 孔偏移 Y
19. relativeAngle 孔相对焊盘旋转角度
20. plated 是否金属化孔壁
21. padType 焊盘功能：0 普通焊盘 1 测试点 2 标识点
22. topSolderExpansion 顶层阻焊扩展：`null` 为遵循规则
23. bottomSolderExpansion 底层阻焊扩展：`null` 为遵循规则
24. topPasteExpansion 顶层助焊扩展：`null` 为遵循规则
25. bottomPasteExpansion 底层助焊扩展：`null` 为遵循规则
26. connectMode 热焊-连接方式：`null` 为遵循规则，其他数据定义同设计规则
27. spokeSpace 热焊-发散间距：`null` 为遵循规则，其他数据定义同设计规则
28. spokeWidth 热焊-发散线宽：`null` 为遵循规则，其他数据定义同设计规则
29. spokeAngle 热焊-发散角度：`null` 为遵循规则，其他数据定义同设计规则
30. unusedInnerLayers 隐藏焊盘层（可选）：被隐藏焊盘的层数组

### 孔

1. 长圆孔
    1. 长圆孔 `ROUND`
    1. 宽
    1. 高
1. 方孔
    1. 方孔 `RECT`
    1. 宽
    1. 高

### 焊盘

孔的旋转与盘的互相独立

1. 长圆焊盘
    1. 长圆焊盘 `ROUND`
    1. 宽
    1. 高
1. 方焊盘
    1. 方焊盘 `RECT`
    1. 宽
    1. 高
    1. 圆角半径
1. 正多边形焊盘
    1. 正多边形焊盘 `NGON` （名称来自 3DSMAX）
    1. 直径
    1. 边数（> 2）
1. 多边形焊盘
    1. 多边形焊盘 `POLY`
    1. 参考复杂多边形，以孔为原点的相对位置


path: format/pcb/panel.md
content: # 拼版

```json
{ "type": "PANELIZE", "ticket": 1 }||
{
  "on":1,
  "row":2,
  "column":3,
  "rowSpacing":5.5,
  "columnSpacing":6.1,
  "onlyOutline":1,
}|
```

1. type 拼版 `PANELIZE`
2. ticket 逻辑时钟
3. on 是否启用
4. row 行数
5. column 列数
6. rowSpacing 行距
7. columnSpacing 列距
8. onlyOutline 是否只拼边框

```json
{ "type": "PANELIZE_STAMP", "ticket": 1 }||
{
  "direction":1,
  "on":1,
  "stampHoleGroupQuantity":3,
  "stampHoleDiameter":8,
  "stampHoleQuantityPerGroup":0,
  "stampHoleSpacing":1,
}|
```

1. type 邮票孔参数：`PANELIZE_STAMP`
2. ticket 逻辑时钟
3. direction 方向：`0` 水平 `1` 垂直
4. on 是否启用（不启用则使用 V-CUT）
5. stampHoleGroupQuantity 邮票孔组数
6. stampHoleDiameter 邮票孔直径
7. stampHoleQuantityPerGroup 邮票孔每组数量
8. stampHoleSpacing 邮票孔间距

```json
{ "type": "PANELIZE_SIDE", "ticket": 1 }||
{
  "direction":0,
  "on":1,
  "sideHeight":5,
  "positionHoleDiameter":3,
  "markDiameter":2,
  "markExpansion":1,
}|
```

1. type 工艺边参数：`PANELIZE_SIDE`
2. ticket 逻辑时钟
3. direction 方向：`0` 水平 `1` 垂直
4. on 是否启用（不启用则不使用工艺边）
5. sideHeight 工艺边高度
6. positionHoleDiameter 定位孔直径（`0` 表示无定位孔）
7. markDiameter Mark 点直径（`0` 表示不启用 Mark 点）
8. markExpansion Mark 点阻焊扩展


path: format/pcb/partition.md
content: # 分区格式

PCB 引入了分区设计，分区设计需要标记大量元素的分区信息，所以采用了如下格式设计

## PARTITION 分区图元

```json
{ "type": "LAYER_PHYS","id": "UUID", "ticket": 1 }||
{
  "name":"分区1",
  "fileUuid":"SUB-PCB-UUID",
  "path":"复杂多边形",
}|
```

1. type 分区：`PARTITION`
2. id 图元编号
3. ticket 逻辑时钟
4. name 分区名称
5. fileUuid 子图 UUID
6. path 分区形状

所有归属于分区的图元都得带上对应的分区图元编号

```json
{ "type": "VIA", "id":"viaUuid", "ticket": 1 }||
{
  "partitionId":"partitionId",// 带上该id,表示归属对应分区
  "groupId":0,
  "locked":1,
  "zIndex":3.223,
  "netName":"GND",
  "ruleName":"asdf",
  "centerX":100,
  "centerY":200,
  "holeDiameter":5,
  "viaDiameter":9,
  "viaType":0,
  "topSolderExpansion":null,
  "bottomSolderExpansion":null,
  "unusedInnerLayers":[17],
}|
```


path: format/pcb/primitive.md
content: # 基础图元格式

## NET 配置网络信息

网络信息和 AD 的设计有区别

-   AD 这里是必选的
-   本格式只是需要有特殊 `网络类型` 和 `网络颜色` 才填写上去
    设计差异的原因在于是否有一个专门的网络设置界面，会列出所有网络去设置

```json
{ "type": "NET","id": "A", "ticket": 1 }||
{
  "netType":"High Speed",
  "specialColor":"#666666",
  "hideRetLine":0,
  "differentialName":"AASDF",
  "isPositiveNet":1,
  "equalLengthGroupName":"ABC",
}|
```

1. type 网络配置 `NET`
2. id 唯一标识，网络名称
3. ticket 逻辑时钟
4. netType 网络类型：`null` 为无类型
5. specialColor 特殊颜色：`null` 为无特殊颜色
6. hideRetLine 是否隐藏飞线
7. differentialName 差分对名称：`null` 为非差分对
8. isPositiveNet 是否差分对正极
9. equalLengthGroupName 等长组名称：`null` 为非等长组

```json
{ "type": "NET","id": "B", "ticket": 1 }||
{
  "netType":null,
  "specialColor":"#666666",
  "hideRetLine":1,
  "differentialName":"AASDF",
  "isPositiveNet":0,
  "equalLengthGroupName":"ABC",
}|
```

```json
{ "type": "NET","id": "C", "ticket": 1 }||
{
  "netType":"High Speed",
  "specialColor":null,
  "hideRetLine":1,
  "differentialName":null,
  "isPositiveNet":0,
  "equalLengthGroupName":null,
}|
```

## PRIMITIVE 图元配置

```json
{ "type": "PRIMITIVE","id": "VIA", "ticket": 1 }||
{
  "display":1,
  "pick":0,
}|
```

1. type 图元配置 `PRIMITIVE`
2. id 唯一标识，图元名称
3. ticket 逻辑时钟
4. display 是否显示
5. pick 是否可拾取

```json
{ "type": "PRIMITIVE","id": "PAD", "ticket": 1 }||
{
  "display":0,
  "pick":1,
}|
```

## GROUP 分组配置

通过分组配置，给每个组一个名称，如果无名称，由 EDA 决定如何显示默认组名

```json
{ "type": "GROUP","id": "2", "ticket": 1 }||
{
  "groupName":"ABCD",
}|
```

1. type 分组配置 `GROUP`
2. id 分组编号
3. ticket 逻辑时钟
4. groupName 名称

```json
{ "type": "GROUP","id": "5", "ticket": 1 }||
{
  "groupName":"中文名称",
}|
```

## CONNECT 图元关联

图元关联用于表达一些图元的内部组合逻辑，例如

-   泪滴与 `LINE` `ARC` `PAD` `VIA` 的联系
-   焊盘与其相关的引脚 3D 外形 `FILL` 的联系
-   3D 外壳中 `CREASE` 与 `BOSS` `SHELL_ENTITY` 的联系
-   PCB 针对封装内图元的覆盖

只支持表达一对多的关系

```json
{ "type": "CONNECT","id": "e3", "ticket": 1 }||{ "relatedIds":["e15", "e18", "e100"] }|
```

1. type 图元关联 `CONNECT`
2. id 主图元编号
3. ticket 逻辑时钟
4. relatedIds 关联的图元编号

多对多的关系可以用多个表达，暂时没有对应场景

```json
{ "type": "CONNECT","id": "e4", "ticket": 1 }||{ "relatedIds":["e5", "e6"] }|
```

```json
{ "type": "CONNECT","id": "e5", "ticket": 1 }||{ "relatedIds":["e4", "e6"] }|
```

```json
{ "type": "CONNECT","id": "e6", "ticket": 1 }||{ "relatedIds":["e4", "e5"] }|
```

PCB 中针对封装内图元的覆盖，使用形如 `/^[a-z]+\d+[a-z]+\d+$/i` 的形式将封装和里面图元 ID 拼一起来引用，表达如下

```json
["DOCTYPE", "PCB", "1.0"]
["COMPONENT", "e13", 5, 1, ...]
["VIA", "e13e20", 0, "GND", "asdf", ....]
["PAD", "e13e25", 1, "GND", 0, "1", ....]
["CONNECT", "e13", ["e13e20", "e13e25"]]
```

封装内容如下

```json
["DOCTYPE", "FOOTPRINT", "1.0"]
["VIA", "e20", 0, "GND", "sss", ....]
["PAD", "e25", 1, "GND", 0, "3", ....]
```

## PROP 附加图元属性

有一些图元属性非必须表达，且相对通用，则用 `PROP` 辅助描述

```json
{ "type": "PROP", "id":"UUID", "ticket": 1 }||{ "color":"#22ee44" }|
```

1. type 附加图元属性：PROP
1. id 被附加的图元编号：有两种编码形式
    1. 普通编号：形式为 `/^[a-z]+\d+$/i`，如 `e1` `e123` 等
    1. 封装实例编号：形式为 `/^[a-z]+\d+[a-z]+\d+$/i`，用于如封装中的丝印等，如 `e1e5` `e12e22` 等
1. color 特殊颜色

```json
{ "type": "PROP", "id":"e7e25", "ticket": 1 }||{ "color":"#22ee44" }|
```

如果要覆盖封装内的图元，则采用此复合编号的形式去描述

## EQLEN_GRP

```json
{ "type": "EQLEN_GRP", "id":"UUID", "ticket": 1 }||
{
  "name":"equal length pad group 2",
  "sort":1.97,
  "pads":
    [
        ["U1:1", "U2:3"],
        ["U1:2", "U1:a"]
    ],
}|
```

1. type 等长组：`EQLEN_GRP`
2. id 唯一编号
3. ticket 逻辑时钟
4. name 等长组名称：全工程唯一
5. sort 排序
6. pads 用 `位号:焊盘编号` 标识焊盘的数组


path: format/pcb/rule.md
content: # 设计规则体系

## 设计规则模板

设计规则模板逻辑上有两种理解方式，PCB 自行根据需要选择

1. 作为其他设计规则的基版，其他设计规则是对模板的覆盖
1. 与其他设计规则互斥，有模板其他设计规则只是暂存，不产生任何效果
1. 作为来源于哪个模板的标识，不影响后续实际规则的效力（当前采用的方案）

```json
{ "type": "RULE_TEMPLATE", "ticket": 1 }||{ "name": "JLCPCB Capability(High Frequency Board)"}|
```

1. type 设计规则模板：`RULE_TEMPLATE`
2. ticket 逻辑时钟
3. name 模板名称

## 设计规则

```json
{ "type": "RULE", "id":"UUID", "ticket": 1 }||
{
  "ruleType":"Safe Clearance",
  "ruleName":"通用",
  "ruleState":1,
  "ruleContext":{},
}|
```

1. type 设计规则：`RULE`
2. ticket 逻辑时钟
3. ruleType 规则类型：EDA 自己决定
4. ruleName 规则名称
5. ruleState 规则状态：0 普通规则 1 默认规则 2 停用规则
6. ruleContext 规则内容：EDA 自己决定

同一 `规则类型` 设计规则出现的顺序，需要和【规则管理】左侧树的顺序一致

## 规则选择器

```json
{ "type": "RULE_SELECTOR", "id":"UUID", "ticket": 1 }||
{
  "ruleSelect":["NET", "GND"],
  "ruleOrder":0,
  "ruleKeyValue":{ "Safe Clearance": "通用", "Other Clearance": "通用" },
}|
```

1. type 规则选择器：`RULE_SELECTOR`
2. ticket 逻辑时钟
3. ruleSelect 选择器
    1. 网络类型：`["NET_CLASS", "High Speed"]`
    2. 网络：`["NET", "GND"]`
    3. 层：`["LAYER", 3]`
    4. 区域：`["REGION", "e10"]`
    5. 封装：`["FOOTPRINT", "0805"]`
    6. 元件：`["COMPONENT", "e100"]`
    7. 覆铜：`["POUR", "e100"]`
    8. 差分对：`["DIFF_PAIR", "asdf"]`
    9. 等长对：`["EQ_LEN_GRP", "fdsa"]`
    10. 未来如果要配置逻辑，可以写逻辑 `["AND", ["NET", "GND"], ["LAYER", 5]]`
4. ruleOrder 优先级：数值越小，优先级越高，建议
    - `0` 元件规则
    - `1` 封装规则
    - `2` 区域规则
    - `3` 网络-网络规则
    - `4` 网络规则
    - `5` 层规则
5. ruleKeyValue 规则，Key 为 规则类，Value 为 规则名称，每个规则类下只能选择一个规则


path: format/pcb/shape.md
content: # 形状图元

## LINE 直线

```json
{ "type": "LINE", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":9.223,
  "netName":"GND",
  "layerId":1,
  "startX":100,
  "startY":200,
  "endX":400,
  "endY":300,
  "width":0.7,
}|
```

1. type 直线 `LINE`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. netName 网络
9. layerId 层
10. startX 开始 X
11. startY 开始 Y
12. endX 结束 X
13. endY 结束 Y
14. width 线宽

## ARC/CARC 圆弧线

圆弧借鉴 Eagle 的数学模型，以 `起始` `结束` 为基准去描述

```json
{ "type": "ARC", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":2.866,
  "netName":"GND",
  "layerId":1,
  "startX":100,
  "startY":200,
  "endX":300,
  "endY":400,
  "angle":-170,
  "width":10,
}|
```

1. type 圆弧线
    - `ARC` 两点交互模式
    - `CARC` 中心圆弧交互模式
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. netName 网络
9. layerId 层
10. startX 起始 X
11. startY 起始 Y
12. endX 结束 X
13. endY 结束 Y
14. angle 圆弧角，逆时针正，顺时针负
15. width 线宽

## 多边形体系

SVG 中 path 是一个对多边形优秀的抽象。
但由于 PCB 内用不到其中相对位置等功能，并且有条件设计更方便解析的方式。
所以仿造 SVG 的 path 创造了一种类似的表达多边形的方式。
多边形体系内 `POLY` `REGION` `POUR` 支持互相转换

### 单多边形的定义

单多边形为首尾重合的一条不间断的线所描述的区域。如果首尾不重合需要将其自动重合。

```json
[300, 200, "L", 400, 200, "ARC", 400, 220, 15, "C", 200, 500, 400, 300, 100, 100]
```

```json
["R", 100, 200, 300, 300, 0]
```

```json
["CIRCLE", 100, 200, 5, 1]
```

#### L 直线模式

`X Y L X Y X Y ...` 模式为直线模式，所有坐标将用直线将其连一一连起来

#### ARC/CARC 圆弧模式

`startX startY ARC angle endX endY` 模式为圆弧模式

-   startX/startY 开始坐标
-   angle：圆弧角，逆时针正，顺时针负
-   endX/endY 结束坐标

`startX startY CARC angle endX endY` 中心圆弧交互模式

#### C 三阶贝塞尔模式

`X1 Y1 C X2 Y2 X3 Y3 X4 Y4 ...` 模式为三阶贝塞尔模式，所有坐标为其控制点

#### R 矩形模式

`R X Y width height rot isCCW round` 矩形模式与其它都不兼容，是一个独立的模式

-   X/Y：左上坐标
-   width：宽
-   height：高
-   rot：旋转角度
-   isCCW：是否逆时针
-   round：圆角半径

#### CIRCLE 圆形模式

`CIRCLE cx cy r isCCW` 圆形模式与其它都不兼容，是一个独立的模式

-   cx/cy：中心点坐标
-   r：半径
-   isCCW：是否逆时针

### 复杂多边形的定义

```json
[[单多边形1：外框], [单多边形2：内洞]]
```

复杂多边形可以包含多个单多边形，固定第一个多边形顺时针，表示外框，后续所有多边形逆时针，表示内洞

## POLY 折线

折线和 `LINE` `ARC` 区别较小，但是其具有保持绘制时【连续的一条线】的概念，以和 `REGION` `FILL` `POUR` 互转

```json
{ "type": "POLY", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":6.417,
  "netName":"GND",
  "layerId":1,
  "width":0.5,
  "path":["单多边形"],
}|
```

1. type 折线 `POLY`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. netName 网络
9. layerId 层
10. width 线宽
11. path 请参考单多边形

## FILL 填充

```json
{ "type": "FILL", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex": 0.794,
  "netName":"GND",
  "layerId":3,
  "width":10,
  "fillStyle":0,
  "path":["复杂多边形"],
}|
```

1. type 填充 `FILL`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. netName 网络
9. layerId 层
10. width 线宽
11. fillStyle 填充模式：0 实心填充 1 网格填充 2 内电层填充
12. path 请参考复杂多边形章节
    1. 对于单次画的多边形，这里只有一个单多边形
    1. 对于组合模式画的多边形，这里才有多个单多边形

## REGION 区域

禁止区域为未来一个很重要的功能，除了辅助手工设计以外，还可以辅助自动布局布线，提供自动化工具除设计规则外，区域范围的约束信息

```json
{ "type": "REGION", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":0.901,
  "layerId":3,
  "width":1,
  "prohibitType":[1, 2, 5],
  "path":["复杂多边形"],
  "name":"aa constraint",

}|
```

1. type 区域 `REGION`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. layerId 层
9. width 线宽
10. prohibitType 禁止类型，可同时存在多个
    1. \*禁止布线与放置填充区域（弃用，但解析要做兼容）
    2. 禁止元件
    3. 禁止过孔
    4. \*禁止覆铜与内电层（弃用，但解析要做兼容）
    5. 禁止布线
    6. 禁止放置填充区域
    7. 禁止覆铜
    8. 禁止内电层
11. path 请参考复杂多边形章节
    1. 对于单次画的多边形，这里只有一个单多边形
    2. 对于组合模式画的多边形，这里才有多个单多边形
12. name 名称（可选）

## POUR 覆铜边框

和之前的覆铜有一个实质性的差别在于，支持复杂多边形
也就是说覆铜区域可以含洞，理论上可以实现文字路径转出来的多边形作为覆铜区域
覆铜按照其在格式内出现的顺序覆铜

```json
{ "type": "POUR", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":0.779,
  "netName":"GND",
  "layerId":1,
  "width":1,
  "name":"TOPGND",
  "order":4,
  "path":["复杂多边形"],
  "pourType":["覆铜类型"],
  "keepIsland":1,
}|
["POUR", "e100", 5, 1, 0.779, "GND", 1, 1, "TOPGND", 4, 复杂多边形, [覆铜类型], 1]
```

1. type 覆铜 `POUR`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. netName 网络
9. layerId 层
10. width 线宽
11. name 覆铜名称
12. order 覆铜优先级
13. path 请参考复杂多边形章节
14. pourType 请参考覆铜类型
15. keepIsland 是否保留孤岛

#### 覆铜类型

##### SOLID 实心填充

```json
["SOLID", 2]
```

1. 实心填充 `SOLID`
1. 最小覆铜细度（生产优化用，AD 里的 Neck），0 为不开启生产优化

```json
["POUR", "e100", "GND", 1, "BOTGND", 2, 复杂多边形, ["SOLID", 2], 1, 0]
```

```json
["POUR", "e100", "GND", 1, "BOTGND", 2, 复杂多边形, ["SOLID", 0], 1, 0]
```

##### LINE 线填充

```json
["LINE", 0, 0, 10, 20]
```

1. 线填充 `LINE`
1. 填充模式：`0` 网格填充 `1` 水平线填充 `2` 垂直线填充
1. 旋转角度
1. 线宽
1. 线距

```json
["POUR", "e100", "GND", 1, "", 9, 复杂多边形, ["LINE", 0, 0, 10, 20], 0.6, 1, 0, 0]
```

## POURED 覆铜结果

```json
{ "type": "POURED", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "targetId":"e100",
  "strokeWidth":0,
  "fill":1,
  "path":["复杂多边形"],
}|
```

1. type 覆铜结果 `POURED`
2. id 图元编号
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. targetId 所属覆铜边框 `POUR` 编号
6. strokeWidth 描边线宽：0 为不描边
7. fill 是否填充
8. path 路径, 复杂多边形

## IMAGE 图片

`IMAGE` 和 `REGION` 极为类似，但是在操作上，`IMAGE` 不存在控制点，不能自由改变其形态，只能进行整体性的放大、缩小、旋转、翻转、平移等操作
当 `IMAGE` 在信号层时，在 DRC 视角下，为一个无网络的，由 `起始` `结束` `旋转角度` `是否镜像` 定义的矩形区域

```json
{ "type": "IMAGE", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":5.5464,
  "layerId":31,
  "startX":200,
  "startY":200,
  "width":400,
  "height":400,
  "angle":45,
  "mirror":1,
  "path":["复杂多边形"],
}|
```

1. type 图片 `IMAGE`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. layerId 层
9. startX 左上 X
10. startY 左上 Y
11. width 宽
12. height 高
13. angle 旋转角度，绕 `起始` 点
14. mirror 原始图片是否水平镜像，镜像以原始图片 BBox 中点进行水平镜像
15. path 多个复杂多边形，请参考复杂多边形章节，这里存储的是原始数据，整个生命周期不需要调整

## TEARDROP 泪滴

泪滴不可选中，不可直接操作，当关联的任意图元发生变化时，EDA 应让其自动消失

```json
{ "type": "TEARDROP", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "netName":"GND",
  "layerId":3,
  "path":"简单多边形",
  "groupId":0,
}|
```

1. type 泪滴 `TEARDROP`
2. id 编号
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. netName 网络
6. layerId 层
7. path 简单多边形
8. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组

## FPC_FILL 柔性工艺补强板

```json
{ "type": "FPC_FILL", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":7.7845,
  "layerId":3,
  "material":"3M468",
  "thickness":7.874,
  "path":"复杂多边形",
}|
```

1. type 填充 `FPC_FILL`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. layerId 层
9. material 材质
    - PI
    - STEEL
    - FR4
    - 3M468
    - 3M9077
    - EMI_Shielding_Film
10. thickness 厚度（注意单位和其它图元一致）
11. path 请参考复杂多边形章节


path: format/pcb/text.md
content: # 文字体系

## STRING 文字

当 `STRING` 在信号层时，在 DRC 视角下，为

1. 无网络的
1. `位置` 为 0,0， `旋转角度` 为 0， `是否镜像` 为 0 的 BBox
1. 进行 `位置` `旋转角度` `是否镜像` 变换后的矩形区域

```json
{ "type": "STRING", "id":"UUID", "ticket": 1 }||
{
  "partitionId":null,
  "groupId":0,
  "locked":1,
  "zIndex":0.2693,
  "layerId":1,
  "positionX":300,
  "positionY":600,
  "text":"我人人有的的和我",
  "fontFamily":"宋体",
  "fontSize":50,
  "strokeWidth":10,
  "bold":0,
  "italic":0,
  "origin":5,
  "angle":15,
  "reverse":1,
  "reverseExpansion":0,
  "mirror":1,
  "width":100,
  "height":200,
  "path":["复杂多边形"],
}|
["STRING", "e100", 0, 1, 0.2693, 1, 300, 600, "我人人有的的和我", "宋体", 50, 10, 0, 0, 5, 15, 1, 0, 1]
```

1. type 文字 `STRING`
2. id 图元编号, 文档内唯一
3. ticket 逻辑时钟
4. partitionId 所属分区编号，为 null 表示无分区，封装忽略该字段
5. groupId 分组编号：0 不分组，非 0 为组标志，相同组标志的为一组
6. locked 是否锁定
7. zIndex Z 轴高度
8. layerId 层
9. positionX 位置 X
10. positionY 位置 Y
11. text 内容
12. fontFamily 字体名称
13. fontSize 字号
14. strokeWidth 粗细
15. bold 是否加粗
16. italic 是否斜体
17. origin 对齐模式 `0` 左顶 `1` 中顶 `2` 右顶 `3` 左中 `4` 中中 `5` 右中 `6` 左底 `7` 中底 `8` 右底
18. angle 旋转角度
19. reverse 是否反相扩展
20. expansion 反相扩展尺寸：反相扩展区域的尺寸，支持负数
21. mirror 是否镜像，一般来说，当一个文字出现在底层，这里也需要相应调整成 `1`
22. width 高，没有则为 null
23. height 宽，没有则为 null
24. path 复杂多边形数组，没有则为 null


path: format/project/blob.md
content: # BLOB 真彩图

```json
{ "type": "META", "id": "BLOB-HASH-ID",  "ticket": 1 }||{ "filename": "dadas", "data": "data:image/png;base64,asdfasdfwer" }|
```

1. filename 文件名
2. data 预留元数据，二进制数据：使用类似 `Data URLs` 的规范，但有区别

    1. 一般格式，与 `Data Urls` 完全兼容 `data:[<mediatype>][;base64],<data>`

        - 如 `data:image/png;base64,asdfasdfwer`
        - 如 `data:text/html,<html></html>`
        - 一般情况下，应尽可能使用一般格式，方便直接使用 Web API 加载，不需要算法转换

    2. 扩展格式，扩展了其功能性，加上了如 gzip/deflate 等编码转换功能 `data:<mediatype>[pipeline],<data>`

    - 如 `data:text/html;gzip;base64,asdfasdf`
        1. 先将 asdfasdf 进行 base64 解码
        2. 再用 gzip 解压缩
        3. 最后才以 text/html 去加载
    - 如 `data:text/css;deflate;aes128;base64,aaaaaaa`
        1. 先将 aaaaaaa 进行 base64 解码
        2. 再用 aes128 解密（具体加解密逻辑待定）
        3. 再用 deflate 解压缩
        4. 最后才以 text/css 去加载此数据

```json
{ "type": "META", "id": "ID",  "ticket": 1 }||{ "filename": "dadas", "data": "data:application/vnd.ms-excel;base64,xxsasdfawerwerqwer" }|
```


path: format/project/common.md
content: # 公共数据

每个文档都会带上基本信息、创建信息、修改信息，这些信息由工程管理维护

### 基本信息

```json
{ "type": "META", "ticket": 1 }||data
```

1. type "META" 基本信息
2. data 具体数据，每个文档不一样，后续单独描述

### 创建信息

每个文档一样

```json
{ "type": "META_CREATE", "ticket": 1 }||
{
    "creator": { "uuid":"UUID", "nickname":"nickname", "username":"username", },
    "createTime": 1725593026474,
}|
```

1. type "META_CREATE" 创建信息
2. creator 创建者
3. createTime 创建时间

### 修改信息

```json
{ "type": "META_MODIFY", "ticket": 1 }||
{
    "modifier": { "uuid":"UUID", "nickname":"nickname", "username":"username", },
    "createTime": 1725593026474,
}|
```

1. type "META_MODIFY" 修改信息
2. modifier 修改者
3. updateTime 更新时间


path: format/project/group.md
content: # 元件分组

## 文档头

```json
{ "type": "DOCHEAD" }||{ "docType": "COMPONENT_GROUP", "uuid": "UUID", "client": "clientID" }|
```

1. type：`DOCHEAD`，文档头标识
2. docType：`COMPONENT_GROUP` 元件分组
3. uuid: 唯一标识，随机 id
4. client：最终一致性的一个终端标识

### META 基本信息

```json
{ "type": "META", "ticket": 1 }||
{
	/** 名称 */
	"title": string,
	/** 子 元件分组的 父 元件分组 uuid */
	"parent": string,
	/** 属于直接变体的元件分组 不参与 元件分组树构建 */
	"belong": string,
	/** 元件分组树中排序 */
	"zIndex": number,
	/** 原理图 */
	"schematicId": string,
}|
```

### GROUP_INDEX 元件分组在变体的排序

```json
{ "type": "GROUP_INDEX", "ticket": 1, "id": "variantId" }||
{
	"zIndex": 1,
}|
```

1. type：`GROUP_INDEX`
2. ticket: 逻辑时钟
3. id：变体 uuid
4. zIndex：在变体中的排序

### GROUP_DATA 属性数据

```json
{ "type": "GROUP_DATA", "id": "e176@uuid",  "ticket": 1 }||data
```

1. type `GROUP_DATA` 属性数据
2. id 组合 id,以`@`分割：
    1. 第一个是图元 id
    2. 第二个是实例页 id
3. data 属性覆盖，数据签名为 `{ [key: string]: string }| `

```json
{ "type": "GROUP_DATA", "id": "e176@uuid1",  "ticket": 1 }||{ "Designator": "U15", "ASDF": "1234" }|
{ "type": "GROUP_DATA", "id": "e177@uuid1",  "ticket": 2 }||{ "NUMBER": 2 }|
{ "type": "GROUP_DATA", "id": "e176@uuid2",  "ticket": 3 }||{ "Author": "abc" }|
```


path: format/project/index.md
content: # 工程日志格式

该文档仅用来描述属于工程但不属于画布的数据，具体的画布数据请查看单独的描述文档。

## 目录

- [公共数据](/cn/format/project/common.md) - 包含基本信息、创建信息、修改信息等
- [基本信息](/cn/format/project/meta.md) - 包含工程配置、板子、原理图、PCB、面板、符号、封装、器件等元数据
- [BLOB 真彩图](/cn/format/project/blob.md) - 真彩图数据格式
- [实例值属性覆盖](/cn/format/project/instance.md) - 实例值属性覆盖格式
- [变体](/cn/format/project/variant.md) - 变体数据格式
- [元件分组](/cn/format/project/group.md) - 元件分组数据格式


path: format/project/instance.md
content: # 实例值属性覆盖

## 文档头

```json
{ "type": "DOCHEAD" }||{ "docType": "INSTANCE", "uuid": "SCH-UNIQUE-ID_$5|e100_$1|e55_$6|e15_$8", "client": "clientID" }|
```

1. type：`DOCHEAD`，文档头标识
2. docType：`INSTANCE` 实例值属性覆盖
3. uuid：层次编号，工程内唯一，已`_`分割 id
    1. 第一个是顶层原理图编号
    2. 最后一个只到 Sheet 编号
    3. 中间所有的都是使用编号组合语法定位的 `Block Symbol`，如 `$1|e2`，其中 `$1` 为 Sheet 编号，`e2` 为 `Block Symbol` 编号
4. client：最终一致性的一个终端标识

## 属性覆盖

```json
{ "type": "INSTANCE_ATTR", "id": "e176",  "ticket": 1 }||data
```

1. type `INSTANCE_ATTR` 实例属性覆盖
2. id 图元编号
3. data 属性覆盖，数据签名为 `{ [parentId: string]: { [key: string]: string }| }|`

```json
{ "type": "DOCHEAD" }||{ "docType": "INSTANCE", "uuid": "SCH-UNIQUE-ID_$5|e100_$1|e55_$6|e15_$8", "client": "clientID" }|
{ "type": "INSTANCE_ATTR", "id": "e176",  "ticket": 1 }||{ "Designator": "U15", "ASDF": "1234" }|
{ "type": "INSTANCE_ATTR", "id": "e176e5",  "ticket": 1 }||{ "NUMBER": 2 }|
{ "type": "INSTANCE_ATTR", "id": "e178",  "ticket": 1 }||{ "Author": "abc" }|
```


path: format/project/meta.md
content: # 基本信息

### 工程配置

存放工程的配置数据，之前是存在后端的工程详情里的

```json
{ "type": "META", "ticket": 1 }||{ "name": "name", "default_sheet": "default_sheet_uuid"}|
```

1. name 工程名称
2. default_sheet 工程的默认图纸

### 板子

```json
{ "type": "META", "ticket": 1 }||{ "title": "title", "sort": 1}|
```

1. title 板子名称
2. sort 排序权重

### 原理图

```json
{ "type": "META", "ticket": 1 }||{ "name": "name", "board":"", "source": "", "version": ""}|
```

1. name 名称
2. board 所属的板子 uuid, 没有则为空
3. source 源文档 uuid
4. version 版本，源文档的更新时间

### 原理图页

```json
{ "type": "META", "ticket": 1 }||
{
    "name": "Page Name",
    "schematic": "SID",
    "description": "描述",
    "sort": 0.5,
    "source": "",
    "version": "",
}|
```

1. name 名称
2. schematic 所属的原理图 uuid
3. description 描述
4. sort 排序权重
5. source 源文档 uuid
6. version 版本，源文档的更新时间

### PCB

```json
{ "type": "META", "ticket": 1 }||
{
    "name": "PCB Name",
    "board": "boardId",
    "description": "描述",
    "parentId":"",
    "sort": 0.5,
    "source": "",
    "version": "",
}|
```

1. name 名称
2. board 所属的板子 uuid, 没有则为空
3. description 描述
4. parentId 父 PCB UUID, 没有则为空
5. sort 排序权重
6. source 源文档 uuid
7. version 版本，源文档的更新时间

子 PCB

```json
{ "type": "META", "ticket": 1 }||
{
    "name": "子PCB Name",
    "board": "",
    "description": "描述",
    "parentId":"UUID",
    "sort": 0.2,
    "source": "",
    "version": "",
}|
```

### 面板

```json
{ "type": "META", "ticket": 1 }||
{
    "name": "Panel Name",
    "description": "描述",
    "sort": 0.5,
}|
```

1. name 名称
2. description 描述
3. sort 排序权重

### 符号

```json
{ "type": "META", "ticket": 1 }||
{
    "name": "Name",
    "description": "描述",
    "type": 2,
    "tags": "tag1",
    "source": "",
    "version": "",
}|
```

1. name 名称
2. description 描述
3. type 符号类型
4. tags 分类标签
5. source 源文档 uuid
6. version 版本，源文档的更新时间

### 封装

```json
{ "type": "META", "ticket": 1 }||
{
    "name": "Name",
    "description": "描述",
    "type": 4,
    "tags": "tag1",
    "source": "",
    "version": "",
    "pcb": "",
}|
```

1. name 名称
2. description 描述
3. type 封装类型
4. tags 分类标签
5. source 源文档 uuid
6. version 版本，源文档的更新时间
7. pcb 所属的 pcb uuid, 默认为空，仅特殊封装有该字段

特殊封装

```json
{ "type": "META", "ticket": 1 }||
{
    "name": "Name",
    "description": "描述",
    "type": 4,
    "tags": "tag1",
    "source": "",
    "version": "",
    "pcb": "pcbUuid",
}|
```

### 器件

```json
{ "type": "META", "ticket": 1 }||
{
    "name": "Name",
    "description": "描述",
    "type": 4,
    "tags": "tag1",
    "source": "",
    "version": "",
    "attributes": {},
    "images": "",
}|
```

1. name 名称
2. description 描述
3. tags 分类标签
4. source 源文档 uuid
5. version 版本，源文档的更新时间
6. attributes 器件属性 Key-Value
7. images 图片链接


path: format/project/variant.md
content: # 变体

## 文档头

```json
{ "type": "DOCHEAD" }||{ "docType": "VARIANT", "uuid": "UUID", "client": "clientID" }|
```

1. type：`DOCHEAD`，文档头标识
2. docType：`VARIANT` 变体数据
3. uuid: 唯一标识，随机 id
4. client：最终一致性的一个终端标识

## META 基本信息

```json
{ "type": "META", "ticket": 1 }||
{
	/** 名称 */
	"title": string,
	/** 描述 */
	"description": string,
	/** 原理图 */
	"schematicId": string,
	/** 排序 */
	"zIndex": number,
	/** 是否有未归组 */
	"notGrouped": boolean,
}|
```


path: format/schematic/attr.md
content: # ATTR 属性

ATTR 是一个较为通用的图元，其含义为

1. 表达一个由 键(KEY)——值(VALUE) 组成的的多个属性中的一个
1. 可以在画布上显示，并控制显示哪些内容，以及样式位置等

当隶属编号没有指定时，则默认隶属于当前块级图元上

```json
{ "type": "ATTR", "id": "UUID", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": false, "zIndex": 0.1, "parentId": "UUID", "key":"string", "value":"string", "keyVisible":false, "valueVisible":false, "positionX":200, "positionY":200, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

1. type 属性名称：ATTR
2. id 唯一编号
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. parentId 隶属编号：隶属于哪个图元，`""` 表示属于当前块 _默认块是文件_
9. key 属性 Key
10. value 属性 Value
11. keyVisible 是否显示 Key
12. valueVisible 是否显示 Value
13. positionX 位置 X：未显示过的属性位置固定为 `null`
14. positionY 位置 Y：未显示过的属性位置固定为 `null`
15. rotation 旋转角度，绕 `位置` 旋转
16. color 颜色
17. fillColor 背景色
18. fontFamily 字体名称
19. fontSize 字体大小，与坐标等单位相同
20. strikeout 是否加删除线
21. underline 是否加下划线
22. italic 是否斜体
23. fontWeight 是否加粗
24. vAlign 垂直对齐模式：0 顶部对齐 1 中间对齐 2 底部对齐
25. hAlign 水平对齐模式：0 左对齐 1 居中 2 右对齐

当属性 Value 中含有 `~` 字符时，XTools 需要实现从开始到结束，遇到第奇数个 `~` 开始文字带上划线，遇到第偶数个 `~` 结束文字带上划线


path: format/schematic/common.md
content: # 通用格式

## 文档头

```json
{ "type": "DOCHEAD" }||{ "docType": "SCH_PAGE", "uuid": "UUID", "client": "clientID" }|
```

```json
{ "type": "DOCHEAD" }||{ "docType": "SYMBOL", "uuid": "UUID", "client": "clientID" }|
```

-   type："DOCHEAD"，文档头标识
-   docType：文档类型，"SCH_PAGE"：原理图、 "SYMBOL"：符号
-   uuid：文档唯一编号，工程内唯一
-   client：最终一致性的一个终端标识

## 画布配置

编辑器附加信息，用于数据分析等功能，目前已占用的一些字段

```json
{ "type": "CANVAS", "ticket": 1 }||
{
  "originX":0,
  "originY":0,
}|
```

1. type："CANVAS"，画布配置信息标识
2. ticket 逻辑时钟
3. originX 画布原点 X
4. originY 画布原点 Y


path: format/schematic/component.md
content: # COMPONENT

-   `COMPONENT` 引用了 Symbol，Symbol 支持多 PART，所以带了 `子库编号` 属性指示具体哪一个，如果是单 PART 则使用默认值 `""`
-   `COMPONENT` 下可绑定许多 `ATTR`，具体的属性行为将由工具定义

### Symbol 类型

| Symbol 类型编号 | Symbol 类型     | 说明                                                                                                                                                                                                                   |
| :-------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2               | Part Symbol     | 普通器件                                                                                                                                                                                                               |
| 17              | Block Symbol    | 层次图符号                                                                                                                                                                                                             |
| 18              | NetFlag Symbol  | 全局网络符号                                                                                                                                                                                                           |
| 19              | NetPort Symbol  | 层次图网络导出符号                                                                                                                                                                                                     |
| 20              | Sheet Symbol    | 专用于提供原理图图纸的重用机制                                                                                                                                                                                         |
| 21              | NoneElec Symbol | 无电气特性符号 NoneElec 是一类不具有 `PIN` 的无电气特性图元<br>也可以用作特殊的图标，版权声明文字等的重用机制<br>NoneElec 全称 None Electrical，不具有电气特性的意思                                                   |
| 22              | Short Symbol    | 短接符 Short Symbol 是一个特殊 Symbol，必须具有两个 `PIN`<br>所有与同一个 `Short Symbol` 的 `PIN` 相连的网络，将在电气特性上对其进行短接<br>比如网络 A 连接到了 PIN1，网络 B 连接到了 PIN2，则表示 A 和 B 是同一个网络 |

### Component 图元

```json
{ "type": "COMPONENT", "id": "UUID", "ticket": 1 }||
{
    "partId": "e176",
    "groupId": 0,
    "positionX": 300,
    "positionY": 200,
    "rotation": 15,
    "isMirror": false,
    "data": {},
}|
```

1. type COMPONENT 标识：COMPONENT
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号
5. groupId 分组编号，不能为 0，没有默认为空
6. zIndex Z 轴高度：所有非属性子元素高度分布在 Z0 ~ Z9 范围内，比如 Z 为 23.554，子元素自动分布在 23.5540 ~ 23.5549 范围内
7. positionX 位置 X
8. positionY 位置 Y
9. rotation 旋转角度：绕 `位置` 旋转
10. isMirror 是否镜像
11. data 纯数据属性：附加信息，用于编辑器内部的一些逻辑

Component 所引用的 Symbol 图元一定是按照如下顺序执行的变换

1. 按照 `旋转角度` 绕原点（0,0）逆时针旋转
2. 如果 `是否镜像` 为 `1`，则绕原点（0,0）所在的 Y 轴进行水平镜像
3. 根据 `位置` 进行平移

或者可以理解成如下等价的变换（但是实现更繁琐一些）

1. 根据 `位置` 进行平移
2. 按照 `旋转角度` 绕 `位置` 逆时针旋转
3. 如果 `是否镜像` 为 `1`，则绕 `位置` 所在的 Y 轴进行水平镜像

```json
{ "type": "ATTR", "id": "e187", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": true, "zIndex": 0.1, "parentId": "e176", "key":"Device", "value":"device-uuid-1", "keyVisible":true, "valueVisible":true, "positionX":300, "positionY":200, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

Device uuid，与 project.json 里 devices 对应的文件名称一致

```json
{ "type": "ATTR", "id": "e188", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": true, "zIndex": 0.1, "parentId": "e176", "key":"Symbol", "value":"symbol-uuid-1", "keyVisible":true, "valueVisible":true, "positionX":300, "positionY":200, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

`COMPONENT` 内的 `ATTR` 会对模板内同名属性覆盖，覆盖 Symbol 后会影响此器件对符号的绑定

```json
{ "type": "ATTR", "id": "e188", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": true, "zIndex": 0.1, "parentId": "e176", "key":"Footprint", "value":"footprint-uuid-1", "keyVisible":true, "valueVisible":true, "positionX":300, "positionY":200, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

`COMPONENT` 内的 `ATTR` 会对模板内同名属性覆盖，覆盖 Footprint 后会影响此器件对封装的绑定

```json
{ "type": "ATTR", "id": "e188", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": true, "zIndex": 0.1, "parentId": "e176", "key":"Designator", "value":"U1", "keyVisible":true, "valueVisible":true, "positionX":300, "positionY":200, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

`COMPONENT` 内的 `ATTR` 会对模板内同名属性覆盖

```json
{ "type": "ATTR", "id": "e180", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": true, "zIndex": 0.1, "parentId": "e176e5", "key":"NUMBER", "value":"1", "keyVisible":true, "valueVisible":true, "positionX":108, "positionY":804.5, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

`PIN` 属性覆盖的方式关键在 `ATTR` 的 `隶属编号` 上
编号分两部分，例如 `e176e5`，其中 `e176` 为 `COMPONENT` 的编号，`e5` 为在模板内的 `PIN` 编号


path: format/schematic/index.md
content: # SCH 原理图类型文档

本章节详细介绍了嘉立创EDA原理图文件的格式规范。原理图文件主要包含以下几个部分：

- [通用配置](/cn/format/schematic/common.md)：文档头和画布配置信息。
- [结构元素](/cn/format/schematic/structure.md)：PART 子库和 GROUP 组合。
- [属性](/cn/format/schematic/attr.md)：图元属性定义。
- [导线](/cn/format/schematic/wire.md)：导线、总线和总线入口。
- [文本](/cn/format/schematic/text.md)：文本元素。
- [形状](/cn/format/schematic/shape.md)：矩形、多边形、圆形、圆弧、贝塞尔曲线、椭圆。
- [引脚](/cn/format/schematic/pin.md)：引脚定义。
- [元件](/cn/format/schematic/component.md)：原理图元件实例。
- [对象](/cn/format/schematic/obj.md)：二进制对象（图片等）。
- [表格](/cn/format/schematic/table.md)：表格和单元格。


path: format/schematic/obj.md
content: # OBJ 二进制内嵌对象

内嵌于图页上的图片和文件等数据，可作为附件下载，以及直接显示（EDA 自行决定，不在格式内要求）

```json
{ "type": "OBJ", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 9.0876,
    "fileName": "a.txt",
    "startX": 200,
    "startY": 300,
    "width": 10,
    "height": 20,
    "rotation": 0,
	"isMirror": false,
	"content": "data:text/plain;base64,MTIzNA==",
}|
```

1. type 二进制内嵌对象标识：OBJ
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. fileName 文件名
9. startX 左上角 X
10. startY 左上角 Y
11. width 宽
12. height 高
13. rotation 旋转角度：绕`左上角`旋转
14. isMirror 是否镜像
15. content 二进制数据，有两种模式
    1. 一般格式，遵循 `Data Urls` 规范 `data:[<mediatype>][;base64],<data>`
        - 如 `data:image/png;base64,asdfasdfwer`
        - 如 `data:text/html,<html></html>`
    2. BLOB 引用模式，`blob:hashid`


path: format/schematic/pin.md
content: # PIN 标号

![image](/storage/images/cn/format/schematic/pin/pin.png)

如图所示

-   所有 PIN 的 `位置 X/Y` 都是离黑色矩形最远的那个端点
-   PIN 1 为 0 度旋转方向，引脚样式 0
-   PIN 2 为 90 度旋转方向，引脚样式 1
-   PIN 3 为 180 度旋转方向，引脚样式 2
-   PIN 4 为 270 度旋转方向，引脚样式 3

```json
{ "type": "PIN", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 2.8772,
    "display": true,
    "electric": 0,
    "positionX": 350,
    "positionY": 170,
    "length": 20,
    "rotation": 0,
    "color": "#880000",
    "pinShape": 3,
}|
```

1. type 图元名称：PIN
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. display 是否显示
9. electric 电气特性：0 UNKNOWN 1 INPUT 2 OUTPUT 3 BI
10. positionX 位置 X
11. positionY 位置 Y
12. length 引脚长度
13. rotation 旋转角度：0 90 180 270
14. color 引脚颜色
15. pinShape 引脚样式：1 Clock 2 DOT，可支持按位或运算，比如 3 = 1 | 2
    举例说明：`0` 无附加 `1` Clock `2` DOT `3` Clock & DOT

```json
{ "type": "ATTR", "id": "e184", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": true, "zIndex": 0.1, "parentId": "e102", "key":"NAME", "value":"VCC", "keyVisible":true, "valueVisible":true, "positionX":108, "positionY":804.5, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

PIN 必须具有 NAME 属性

```json
{ "type": "ATTR", "id": "e185", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": true, "zIndex": 0.1, "parentId": "e102", "key":"NUMBER", "value":"1", "keyVisible":true, "valueVisible":true, "positionX":108, "positionY":804.5, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

PIN 必须具有 NUMBER 属性


path: format/schematic/shape.md
content: # 形状图元

## RECT 矩形

矩形由其对角的两个点定义，其旋转是绕`点1`进行的

```json
{ "type": "RECT", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 7.35,
    "dotX1": 340,
    "dotY1": 210,
    "dotX2": 100,
    "dotY2": 200,
    "radiusX": 40,
    "radiusY": 30,
    "rotation": 90,
    "strokeColor": null,
    "strokeStyle": 0,
    "fillColor": "",
    "strokeWidth": null,
    "fillStyle": 1,
}|
```

1. type 图元名称：RECT
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. dotX1 点 1 X
9. dotY1 点 1 Y
10. dotX2 点 2 X
11. dotY2 点 2 Y
12. radiusX 圆角半径 X：`0` 表示非圆角
13. radiusY 圆角半径 Y：`0` 表示非圆角
14. rotation 旋转角度：绕 `点1` 旋转
15. strokeColor 颜色，null 为默认
16. strokeStyle 样式：0 实线 1 短划线 2 点线 3 点划线
17. fillColor 填充颜色："" 不填充，填充自动闭合起始点和结束点
18. strokeWidth 宽度，null 为默认
19. fillStyle 填充样式：0 无 1 实心 2 网格 3 横线 4 竖线 5 菱形 6 左斜线 7 右斜线

## POLY 多边形

```json
{ "type": "POLY", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 7.35,
    "points": [390, 260, 450, 300, 560, 280, 540, 320],
    "closed": false,
    "strokeColor": null,
    "strokeStyle": 0,
    "fillColor": "",
    "strokeWidth": null,
    "fillStyle": 1,
}|
```

1. type 图元名称：POLY
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. points 点集坐标：X Y X Y X Y ...
9. closed 是否自动闭合：如果自动闭合，则结束点会自动连上起始点
10. strokeColor 颜色，null 为默认
11. strokeStyle 样式：0 实线 1 短划线 2 点线 3 点划线
12. fillColor 填充颜色："" 不填充，填充自动闭合起始点和结束点
13. strokeWidth 宽度，null 为默认
14. fillStyle 填充样式：0 无 1 实心 2 网格 3 横线 4 竖线 5 菱形 6 左斜线 7 右斜线

## CIRCLE 圆

```json
{ "type": "CIRCLE", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 2.332,
    "centerX": 430,
    "centerY": 200,
    "radius": 21,
    "strokeColor": null,
    "strokeStyle": 0,
    "fillColor": "",
    "strokeWidth": null,
    "fillStyle": 1,
}|
```

1. type 图元名称：CIRCLE
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. centerX 圆心 X
9. centerY 圆心 Y
10. radius 半径 r
11. strokeColor 颜色，null 为默认
12. strokeStyle 样式：0 实线 1 短划线 2 点线 3 点划线
13. fillColor 填充颜色："" 不填充，填充自动闭合起始点和结束点
14. strokeWidth 宽度，null 为默认
15. fillStyle 填充样式：0 无 1 实心 2 网格 3 横线 4 竖线 5 菱形 6 左斜线 7 右斜线

## ARC 圆弧

```json
{ "type": "ARC", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 0.8689,
    "startX": -10,
    "startY": 0,
    "referX": 0,
    "referY": 10,
    "endX": 10,
    "endY": 0,
    "strokeColor": null,
    "strokeStyle": 0,
    "fillColor": "",
    "strokeWidth": null,
    "fillStyle": 1,
}|
```

1. type 图元名称：ARC
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. startX 起始 X
9. startY 起始 Y
10. referX 参考 X
11. referY 参考 Y
12. endX 结束 X
13. endY 结束 Y
14. strokeColor 颜色，null 为默认
15. strokeStyle 样式：0 实线 1 短划线 2 点线 3 点划线
16. fillColor 填充颜色："" 不填充，填充自动闭合起始点和结束点
17. strokeWidth 宽度，null 为默认
18. fillStyle 填充样式：0 无 1 实心 2 网格 3 横线 4 竖线 5 菱形 6 左斜线 7 右斜线

## BEZIER 三阶贝塞尔线条

```json
{ "type": "BEZIER", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 2.1002,
    "controls": [10, 10, 30, 20, 100, 30, 50, 70],
    "strokeColor": null,
    "strokeStyle": 0,
    "fillColor": "",
    "strokeWidth": null,
    "fillStyle": 1,
}|
```

1. type 图元名称：BEZIER
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. controls 控制点：X1 Y1 X2 Y2 X3 Y3 X4 Y4 ...
9. strokeColor 颜色，null 为默认
10. strokeStyle 样式：0 实线 1 短划线 2 点线 3 点划线
11. fillColor 填充颜色："" 不填充，填充自动闭合起始点和结束点
12. strokeWidth 宽度，null 为默认
13. fillStyle 填充样式：0 无 1 实心 2 网格 3 横线 4 竖线 5 菱形 6 左斜线 7 右斜线

## ELLIPSE 椭圆

```json
{ "type": "ELLIPSE", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 6.23,
    "centerX": 670,
    "centerY": 325,
    "radiusX": 220,
    "radiusY": 20,
    "rotation": 0,
    "strokeColor": null,
    "strokeStyle": 0,
    "fillColor": "",
    "strokeWidth": null,
    "fillStyle": 1,
}|
```

1. type 图元名称：ELLIPSE
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. centerX 中点 cx
9. centerY 中点 cy
10. radiusX 水平半径 rx
11. radiusY 垂直半径 ry
12. rotation 旋转角度 rot
13. strokeColor 颜色，null 为默认
14. strokeStyle 样式：0 实线 1 短划线 2 点线 3 点划线
15. fillColor 填充颜色："" 不填充，填充自动闭合起始点和结束点
16. strokeWidth 宽度，null 为默认
17. fillStyle 填充样式：0 无 1 实心 2 网格 3 横线 4 竖线 5 菱形 6 左斜线 7 右斜线


path: format/schematic/structure.md
content: # 结构图元

## PART 子库

`PART` 只有符号页才有
如果是单 Part 器件也必须有一个 `PART`，子库编号留空 `""`

```json
{ "type": "PART","id":"partId", "ticket": 1 }||{"BBOX": [-10, -20, 10, 20]}|
```

1. type 子库图元：PART
2. id 子库编号
3. ticket 逻辑时钟
4. 内部参数：Key-Value
    - 预留 `BBOX` 为能刚好框住 PART 下所有图元的矩形包围盒任意对角的两个点
      **XTools 核心逻辑不应关注这个属性**
    - 其它为编辑器附加信息，用于数据分析等功能，可选

符号页的所有图元带上对应的子库编号，表示归属于该子库

```json
{ "type": "WIRE", "id": "UUID", "ticket": 1 }||
{
    "partId": "partId", // 符号图元都带上该子库id
    "groupId": 0,
    "locked": false,
    "zIndex": 0.235,
    "dots": [
        [310, 550, 400, 550, 400, 460],
        [480, 460, 400, 460],
        [400, 330, 400, 460]
    ],
    "strokeColor": null,
    "strokeStyle": 0,
    "fillColor": "",
    "strokeWidth": null,
    "fillStyle": 1,
}|
```

## GROUP 分组控制

```json
{ "type": "GROUP", "id": "UUID", "ticket": 1 }||{ "groupId": "1", "parentId": "0", "title": "Logo" }|
```

1. type 分组控制 `GROUP`
2. id 唯一编号
3. ticket 逻辑时钟
4. groupId 分组编号，不能为 0
5. parentId 父级分组编号，为 0 则表示无父级
6. title 分组名称，无名称为空字符串 `""`


path: format/schematic/table.md
content: # 表格图元

## TABLE 表格

```json
{ "type": "TABLE", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "startX": 30,
    "startY": 40,
    "rowSizes": [32, 40, 32, 32, 25],
    "colSizes": [33, 33, 44, 44, 11],
    "rowLocked": [0, 0, 1, 0, 0],
	"colLocked": [0, 1, 0, 0, 0],
    "rotation": 0,
}|
```

1. type 表格：`TABLE`
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. startX 左上角 X
7. startY 左上角 Y
8. rowSizes 行高
9. colSizes 列宽
10. rowLocked 行锁定
11. colLocked 列锁定
12. rotation 旋转角度

## TABEL_CELL 表格单元格

```json
{ "type": "TABLE", "id": "UUID", "ticket": 1 }||
{
    "tableId": "tableId",
    "value": "abc\ndef\nghi",
    "rowIndex": 2,
    "columnIndex": 5,
    "rowSpan": 1,
    "colSpan": 3,
	"topStyle": {
        "strokeColor": null,
	    "strokeStyle": 0,
	    "fillColor": "",
	    "strokeWidth": null,
	    "fillStyle": 1,
    },
    "rightStyle": {
        "strokeColor": null,
	    "strokeStyle": 0,
	    "fillColor": "",
	    "strokeWidth": null,
	    "fillStyle": 1,
    },
    "bottomStyle": {
        "strokeColor": null,
	    "strokeStyle": 0,
	    "fillColor": "",
	    "strokeWidth": null,
	    "fillStyle": 1,
    },
    "leftStyle": {
        "strokeColor": null,
	    "strokeStyle": 0,
	    "fillColor": "",
	    "strokeWidth": null,
	    "fillStyle": 1,
    },
    "leftStyle": {
        "strokeColor": null,
	    "strokeStyle": 0,
	    "fillColor": "",
	    "strokeWidth": null,
	    "fillStyle": 1,
    },
    "fontStyle": {
        "color": "#fff",
	    "fillColor": "#fff",
	    "fontFamily": "宋体",
	    "fontSize": 12,
	    "strikeout": false,
	    "underline": false,
	    "italic": false,
	    "fontWeight": false,
	    "vAlign": 0 ,
	    "hAlign": 2,
    },
    "lineHeight": 12,
}|
```

1. type 表格单元格：`TABLE_CELL`
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. tableId 表格编号
5. value 内容
6. rowIndex 行
7. columnIndex 列
8. rowSpan 宽度（占多少列）
9. colSpan 高度（占多少行）
10. topStyle 边框线形样式（上）
11. rightStyle 边框线形样式（右）
12. bottomStyle 边框线形样式（下）
13. leftStyle 边框线形样式（左）
14. fontStyle 字体样式
15. lineHeight 行间距


path: format/schematic/text.md
content: # TEXT 文本

```json
{ "type": "TEXT", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 4.12,
    "positionX": 109,
    "positionY": 804.5,
    "rotation": 0,
    "value": "任意字符doukeyi@!@#$",
    "color": "#fff",
    "fillColor": "#fff",
    "fontFamily": "宋体",
    "fontSize": 12,
    "strikeout": false,
    "underline": false,
    "italic": false,
    "fontWeight": false,
    "vAlign": 0 ,
    "hAlign": 2,
}|
```

1. type 图元名称：TEXT
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. positionX 文本坐标 X
9. positionY 文本坐标 Y
10. rotation 旋转角度，绕 文本坐标 旋转
11. value 文本内容：任意字符
12. color 颜色
13. fillColor 背景色
14. fontFamily 字体名称
15. fontSize 字体大小，与坐标等单位相同
16. strikeout 是否加删除线
17. underline 是否加下划线
18. italic 是否斜体
19. fontWeight 是否加粗
20. vAlign 垂直对齐模式：0 顶部对齐 1 中间对齐 2 底部对齐
21. hAlign 水平对齐模式：0 左对齐 1 居中 2 右对齐


path: format/schematic/wire.md
content: # 连线图元

## WIRE 导线

```json
{ "type": "WIRE", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 0.235,
    "dots": [
        [310, 550, 400, 550, 400, 460],
        [480, 460, 400, 460],
        [400, 330, 400, 460]
    ],
    "strokeColor": null,
    "strokeStyle": 0,
    "fillColor": "",
    "strokeWidth": null,
    "fillStyle": 1,
}|
```

1. type 图元名称：WIRE
2. id 唯一编号
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. dots 坐标：分成多段线，每段都是连续的一组 X1 Y1 X2 Y2 X3 Y3 ... 描述的线
9. strokeColor 颜色，null 为默认
10. strokeStyle 样式：0 实线 1 短划线 2 点线 3 点划线
11. fillColor 填充颜色："" 不填充，填充自动闭合起始点和结束点
12. strokeWidth 宽度，null 为默认
13. fillStyle 填充样式：0 无 1 实心 2 网格 3 横线 4 竖线 5 菱形 6 左斜线 7 右斜线

```json
{ "type": "ATTR", "id": "e200", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": true, "zIndex": 0.1, "parentId": "e271", "key":"NET", "value":"GND", "keyVisible":true, "valueVisible":true, "positionX":108, "positionY":804.5, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

导线必须带上 NET 属性标识网络名称

## BUS 总线

```json
{ "type": "BUS", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 0.235,
    "dots": [
        [310, 550, 400, 550, 400, 460],
        [480, 460, 400, 460],
        [400, 330, 400, 460]
    ],
    "strokeColor": null,
    "strokeStyle": 0,
    "fillColor": "",
    "strokeWidth": null,
    "fillStyle": 1,
}|
```

1. type 图元名称：BUS
2. id 唯一编号
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. dots 坐标：分成多段线，每段都是连续的一组 X1 Y1 X2 Y2 X3 Y3 ... 描述的线
9. strokeColor 颜色，null 为默认
10. strokeStyle 样式：0 实线 1 短划线 2 点线 3 点划线
11. fillColor 填充颜色："" 不填充，填充自动闭合起始点和结束点
12. strokeWidth 宽度，null 为默认
13. fillStyle 填充样式：0 无 1 实心 2 网格 3 横线 4 竖线 5 菱形 6 左斜线 7 右斜线

```json
{ "type": "ATTR", "id": "e200", "ticket": 1 }||
{ "partId": "", "groupId": 0, "locked": true, "zIndex": 0.1, "parentId": "e271", "key":"NET", "value":"A[1:5]", "keyVisible":true, "valueVisible":true, "positionX":108, "positionY":804.5, "rotation":0, "color":null, "fillColor":null, "fontFamily":null, "fontSize":null, "strikeout":null, "underline":null, "italic":null, "fontWeight":null, "vAlign":0, "hAlign":2,}|
```

总线必须带上 NET 属性标识网络名称

## BUSENTRY 总线接入标识

![image](/storage/images/cn/format/schematic/wire/ripper.png)

-   如图所示
    -   浅黄色为 `BUS`
    -   绿色圆角菱形，以及其向右延伸的一个类似 `PIN` 的图形，为 `BUSENTRY`
    -   蓝色为 `Wire`
-   端点为 `WIRE` 和 `BUSENTRY` 类似 `PIN` 的最右侧端点接触的那个端点的坐标
-   因为 `WIRE` 和 `BUS` 可以是任意角度接入的，所以需要指定其旋转方向以和 `WIRE` 的接入方向一致，例如图内是 180 度
-   `BUSENTRY` 固定一格长
-   `BUSENTRY` 具体的图形，由 XTools 最终解释，不在格式内限定

```json
{ "type": "BUSENTRY", "id": "UUID", "ticket": 1 }||
{
    "partId": "",
    "groupId": 0,
    "locked": false,
    "zIndex": 0.235,
    "busGroupId": 4,
    "order": 4,
    "pointX": 500,
    "pointY": 600,
    "rotation": 90,
}|
```

1. type 图元名称：BUSENTRY
2. id 编号：文件内唯一
3. ticket 逻辑时钟
4. partId 子库编号，符号页专属，原理图忽略该字段
5. groupId 分组编号，不能为 0，没有默认为空
6. locked 是否锁定
7. zIndex Z 轴高度
8. busGroupId 顺序编号：在隶属的 BUS 里的顺序编号，可重复
   比如 BUS 网络为 A[2:3]B[7:6] 可以具有 0 1 2 3 0 1 2 3 ... 一系列顺序编号的 BUSENTRY，其中
   0 一定代表分支 A2B7
   1 一定代表分支 A2B6
   2 一定代表分支 A3B7
   3 一定代表分支 A3B6
9. pointX 端点 X
10. pointY 端点 Y
11. rotation 旋转角度：绕 `端点` 旋转


path: guide/ancillary-projects/pro-api-sdk.md
content: <!--@include: @/private/pro-api-sdk/README.en.md{3,}-->


path: guide/ancillary-projects/pro-api-types.md
content: ---
next: false
---

<!--@include: @/node_modules/@jlceda/pro-api-types/README.en.md{3,}-->


path: guide/ancillary-projects.md
content: # Ancillary Projects

The current EasyEDA Professional Edition Extension API provides the following helper items that you can use for a more complete development experience:

| Project                                                      | Type              | Badges                                                       | License                                                      | Description                    |
| ------------------------------------------------------------ | ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------ |
| [pro-api-sdk](./ancillary-projects/pro-api-sdk)              | Git Repo          | <a href="https://github.com/easyeda/pro-api-sdk" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/github/stars/easyeda/pro-api-sdk" alt="GitHub Repo Stars" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> <a href="https://github.com/easyeda/pro-api-sdk/issues" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/github/issues/easyeda/pro-api-sdk" alt="GitHub Issues" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> | <a href="https://choosealicense.com/licenses/apache-2.0/" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/github/license/easyeda/pro-api-sdk" alt="GitHub License" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> | Extension Development SDK      |
| [pro-api-types](./ancillary-projects/pro-api-types)          | npm Package       | <a href="https://www.npmjs.com/package/@jlceda/pro-api-types" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/npm/v/%40jlceda%2Fpro-api-types" alt="NPM Version" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> | <a href="https://choosealicense.com/licenses/apache-2.0/" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/npm/l/%40jlceda%2Fpro-api-types" alt="NPM License" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> | Extension API Type Definitions |
| [eext-run-api-gateway](https://ext.lceda.cn/item/oshwhub/run-api-gateway) | EasyEDA Extension | <a href="https://github.com/easyeda/eext-run-api-gateway" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/github/stars/easyeda/eext-run-api-gateway" alt="GitHub Repo Stars" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> <a href="https://github.com/easyeda/eext-run-api-gateway/issues" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/github/issues/easyeda/eext-run-api-gateway" alt="GitHub Issues" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> | <a href="https://choosealicense.com/licenses/apache-2.0/" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/github/license/easyeda/eext-run-api-gateway" alt="GitHub License" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> | EDA \<-\> AI Gateway Extension |
| [easyeda-api-skill](https://clawhub.ai/yanranxiaoxi/easyeda-api) | AI Skill          | <a href="https://github.com/easyeda/easyeda-api-skill" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/github/stars/easyeda/easyeda-api-skill" alt="GitHub Repo Stars" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> <a href="https://github.com/easyeda/easyeda-api-skill/issues" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/github/issues/easyeda/easyeda-api-skill" alt="GitHub Issues" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> | <a href="https://github.com/aws/mit-0" style="vertical-align: inherit;" target="_blank"><img src="https://img.shields.io/github/license/easyeda/easyeda-api-skill" alt="GitHub License" class="not-medium-zoom-image" style="display: inline; vertical-align: inherit;" /></a> | Extension API AI Skill         |



path: guide/error-handling.md
content: # Error Handling

## Disable Extensions and Scripting Systems Globally

When you encounter an exception caused by an extension that prevents you from removing the extension through the normal route (such as corrupted or masked data in the top menu bar, or an uninstall returning an error), you can globally disable the extension and the scripting system by adding the `safetyMode=true` parameter within the URL of the EasyEDA Professional editor:

```diff
- https://pro.easyeda.com/editor
+ https://pro.easyeda.com/editor?safetyMode=true
```

::: tip

If you wish to enter debug mode at the same time, you can add the `cll=debug` parameter again:

```diff
- https://pro.easyeda.com/editor?safetyMode=true
+ https://pro.easyeda.com/editor?safetyMode=true&cll=debug
```

:::

## Remove All Extensions Globally

::: danger

**DANGEROUS!** All your installed extensions and standalone scripts will be removed and cannot be recovered. This method should only be used if a serious error is confirmed to be caused by an extension and cannot be resolved by conventional means.

:::

::: details Thanos mode switch

```diff
- https://pro.easyeda.com/editor
+ https://pro.easyeda.com/editor?DANGEROUS_OPERATION_DeleteExtensionStorage=true
```

:::


path: guide/extension-json.md
content: # Extension Configuration File

In order to define the properties of an extension and the various functions that an extension can invoke, each extension should have an extension configuration file named `extension.json` in the root directory with the following default contents:

<<< @/private/pro-api-sdk/extension.json{json}

## name <Badge type="tip" text="string" />

Extension name. It can only contain lowercase English characters `a-z`, numbers `0-9`, and underscores `-`, and is `5-30` characters long.

## uuid <Badge type="tip" text="string" />

UUID. A unique ID for the extension that can contain only lowercase English characters `a-z`, numbers `0-9`, and is `32` characters long.

## displayName <Badge type="tip" text="string" />

Display name.

## description <Badge type="tip" text="string" />

Description.

## version <Badge type="tip" text="string" />

Version number. The format is `major.minor.patch`.

## publisher <Badge type="tip" text="string" />

Developer Information.

## engines <Badge type="tip" text="Object" /> <Badge type="warning" text="feature" />

The engine to which the extension applies.

### engines.eda <Badge type="tip" text="string" /> <Badge type="warning" text="feature" />

Extended adapted version of EasyEDA Professional (online).

## license <Badge type="tip" text="string" />

Open-source licensing terms. It is recommended to go to [Choose a License](https://choosealicense.com/) to select the appropriate open source license for your project.

## repository <Badge type="tip" text="Object" /> <Badge type="warning" text="feature" /> <Badge type="info" text="in working" />

Repository information for the source code of the extension.

### repository.type <Badge type="tip" text="string" /> <Badge type="warning" text="feature" /> <Badge type="info" text="in working" />

The type of source code repository. Optional values are `extension-store` `git` `mercurial` `svn` `ftp` `github` `gitlab` `gitlab-selfhosted` `gitee` `gitea` `bitbucket` `coding` `gnu-savannah` ` gitbucket` `gogs`.

### repository.url <Badge type="tip" text="string" /> <Badge type="warning" text="feature" /> <Badge type="info" text="in working" />

Source code repository URL.

## categories <Badge type="tip" text="string | Array<string>" />

The extension's classification. Optional values are `Schematic` `Symbol` `PCB` `Footprint` `Panel` `Library` `Project` `Other`.

## keywords <Badge type="tip" text="Array<string>" />

Keywords.

## images <Badge type="tip" text="Object" />

Images.

### images.logo <Badge type="tip" text="string" />

Logo. Size `1:1`, PNG/JPEG format. Logos can be drawn using an AI generation tool such as [AutoDraw](https://www.autodraw.com/) and a minimum size of `500×500` is recommended.

### images.banner <Badge type="tip" text="string" /> <Badge type="warning" text="feature" />

Banner. Size `64:27`, for presentation of extension's store page, JPEG format.

## homepage <Badge type="tip" text="string" />

Project homepage.

## bugs <Badge type="tip" text="string" />

Vulnerability feedback channel. Please fill in a correct URI.

## activationEvents <Badge type="tip" text="Object" /> <Badge type="warning" text="feature" /> <Badge type="info" text="in working" />

Extension's activation event.

## entry <Badge type="tip" text="string" />

Entry file. No modification is recommended, it is correctly defined within the SDK.

## dependentExtensions <Badge type="tip" text="Object" /> <Badge type="warning" text="feature" /> <Badge type="info" text="in working" />

Dependencies on other extensions. Supports the use of 32-bit UUIDs of extensions in the Extension Store (automatic pulling supported), or user-defined extension names (manual upload required).

## headerMenus <Badge type="tip" text="Object" />

The header menu registered when the extension is initialized.

The header menu is currently supported to be configured separately according to the following pages:

```json
{
	"headerMenus": {
		"home": [], // [!code focus:9]
		"blank": [],
		"sch": [],
		"symbol": [],
		"pcb": [],
		"footprint": [],
		"pcbView": [],
		"panel": [],
		"panelView": []
	}
}
```

### headerMenus[].id <Badge type="tip" text="string" />

Menu item ID. must be unique.

### headerMenus[].title <Badge type="tip" text="string" />

Menu item title.

### headerMenus[].menuItems <Badge type="tip" text="Object" />

Menu item subitems. Up to two levels of subitems can be nested.

`menuItems` conflicts with `registerFn`, only one of them is allowed to exist in the same level.

### headerMenus[].registerFn <Badge type="tip" text="string" />

Menu associated registered method. The method here is associated with a method exported within the code of this extension, you need to export the specified method as an `ES Module` using `export` and fill in its method name here.

`registerFn` conflicts with `menuItems`, only one of them is allowed to exist in the same level.


path: guide/extensions-marketplace.md
content: # Extensions Marketplace

EasyEDA Extensions Marketplace is under developing, you can refer China site [https://ext.lceda.cn](https://ext.lceda.cn),, which is a professional platform for users to download and share extensions.

If you want to learn how to develop extensions, please refer to the [how-to-start](./how-to-start), which describes in detail how to install the development environment and build your own EasyEDA Pro extension from scratch.

## Publishing Your Extension

When you have fully verified the functionality of the extension you have developed and wish to share it with other users, please visit the [EasyEDA Extensions Marketplace](https://ext.easyeda.com/) and click the **Extension Management** button in the upper right corner:

![](/storage/images/cn/api/guide/how-to-publish/how-to-publish_20250428_112144.jpg)

Enter the extension management page, which supports uploading, publishing and versioning of extensions.

Click the **Extension Upload** button to upload your first extension that meets the following requirements:

1. The extension `extension.json` should contain the following attributes: `name`, `uuid`, `displayName`, `description`, `version`, and `license`;
2. select and fill in at least one or more of the required extension types (`categories`);
3. the extension must provide a custom icon and must not use the default `logo` provided in the SDK, the recommended icon size ratio is `1:1`, the format must be PNG or JPEG, the content must be clear without risk of infringement, and the file size must not exceed `5 MiB`;
4. make sure that the entry file (`entry`) of the extension exists and is valid;
5. the value of the `name` attribute must not be duplicated across extensions with different `uuid`;
6. include a detailed description of the extension's functionality and usage in the `README.md` file;
7. if necessary, keep an change log for the extension in the `CHANGELOG.md` file;
8. the extension **DOESN'T** contain private information, such as your phone numbers.

Select your compiled `.eext` file in the upload pop-up window and upload it. The first uploaded extension will automatically create a namespace into which all subsequent uploads of the extension (identified by `uuid`) will be grouped.

You can view the extension's name, description, version, install count, updated time, and other information on the namespace cover:

![](/storage/images/cn/api/guide/how-to-publish/how-to-publish_20250428_135832.jpg)

After the extension is uploaded, it will automatically enter the review process. After approval, it will be listed in the marketplace:

![](/storage/images/cn/api/guide/extensions-marketplace/extensions-marketplace_20250523_093133.jpg)

After waiting for the review to complete, the review status will change to **Passed**. If there is a case that the review is not passed, please check the reason in the message notification in time and check the non-compliant content in the extension:

![](/storage/images/cn/api/guide/how-to-publish/how-to-publish_20250428_140419.jpg)

After approval, other users will be able to view your extension details and download the uploaded version:

![](/storage/images/cn/api/guide/how-to-publish/how-to-publish_20250428_140709.jpg)

You can view the extension's detail page, where the `README.md` and `CHANGELOG.md` contents of the extension file will be displayed:

![](/storage/images/cn/api/guide/how-to-publish/how-to-publish_20250428_141157.jpg)

All published versions of the extension are listed in the history:

![](/storage/images/cn/api/guide/how-to-publish/how-to-publish_20250428_141328.jpg)

You can leave ratings and reviews of the extension in the comments section:

![](/storage/images/cn/api/guide/how-to-publish/how-to-publish_20250428_141456.jpg)

You can also downgrade the namespace of an extension at any time on the extension management page. This does not affect the status of uploaded versions, and you can also individually unpublish a specific version in the versioning management.


path: guide/how-to-start.md
content: # How to Get Started <Badge type="tip" text="Intro" />

In the EasyEDA Professional extension engine, all extensions are independent JavaScript scripts running under their own scope chains.

Each extension requires a UUID as the uniquely identifiable name of the extension, and this UUID exists in two cases:

1. the extension has been included and referenced from the EasyEDA Pro Extension Store, or the extension developer has requested a UUID for the extension and filled in the `uuid` field in `extension.json`, in this case, the UUID is an auto-generated 32-bit string, and you can find it on the Extension Store page for the extension;
2. if the extension is not included and does not fill in the `uuid` field, then the UUID is the `name` field defined by the extension developer in `extension.json`, please be careful about using this field as the name of the extension's interdependent references as it is always variable and may be renamed.

::: info

If you are using [pro-api-sdk](./ancillary-projects/pro-api-sdk), a new UUID will be automatically generated for you the first time you run `npm run build`.

If you wish to build the full development environment manually, you can also safely use <code id="generatedUuid"></code> as the UUID for the new extension, which is randomly generated when you visit the current page.

:::

All user extensions run locally on the client, which means you can write them in JavaScript according to the [ECMAScript Next](https://262.ecma-international.org/) specification, but note that in the main thread, there are limitations on accessing the DOM, external requests, local file system, and other browser APIs. However, it should be noted that in the main thread, calls to the DOM, external requests, local filesystem, and other browser APIs will be limited, and we will provide predefined interfaces in the extension APIs to address the need for this type of access.

::: tip

EasyEDA offers a wide range of extension examples, allowing users to view the source code and compile it for use:
Extensions source code: [https://github.com/easyeda](https://github.com/easyeda)
Extensions marketplace (China Site, the global site is under developing): [https://ext.lceda.cn/](https://ext.lceda.cn/)

:::

## Development Environment (Computer)

In order to facilitate the environment configuration, we provide [pro-api-sdk](https://gitee.com/jlceda/pro-api-sdk), and we recommend all developers to use this SDK for development, and this document will be based on this SDK to explain. You can get and configure the SDK environment in the following ways:

### I. Install Visual Studio Code

Visual Studio Code is the most recommended IDE for novice developers, hereafter referred to as **VSCode**, and you can download it from its [official website](https://code.visualstudio.com/#alt-downloads).

If you don't understand the difference between the versions, please download the version indicated in the figure below (Windows System Installer x64):

![VS Code Windows System Installer x64](/storage/images/cn/api/guide/how-to-start/how-to-start_20240729_170651.png)

### II. Install Git

Git is the recommended tool for pulling SDKs, and you can download it from its [official website](https://git-scm.com/download).

On the right side of the official download page, click `Download for Windows`:

![Git Download for Windows](/storage/images/cn/api/guide/how-to-start/how-to-start_20240729_170746.png)

### III. Install Node.js

Node.js is the runtime software necessary to build TypeScript natively, and you can download it from its [official website](https://nodejs.org/en/download/prebuilt-installer).

The official download page is a guided interactive page, so if you don't need it, just follow the instructions below:

I want `Current` version of Node.js for `Windows` running `x64`

Then click the `Download Node.js` button to download the Node.js installer.

::: warning

If you wish to use a customized version of Node.js, make sure it is no lower than `20.5.0`, which is the minimum version required for this project.

:::

::: tip

You can check the version of Node.js you have installed by typing `node -v` in the console, if the version is lower than `20.5.0`, follow the steps above to install Node.js.

:::

### IV. Pulling SDK Repository Locally

1. Before you start pulling, you need to first create a subfolder on your local disc where you will keep all your development materials. For example, you can create a subfolder named `easyeda-extension` under the `D:` disc.

    ::: warning

    Please try not to include `spaces` `non-ASCII characters` in the path to avoid surprises in subsequent operations.

    :::

2. Once created, open the Windows PowerShell tool (right-click on the `Windows Logo Key` and select the `Windows PowerShell (Administrator)` option).

3. Navigate within Windows PowerShell to the folder you just created, in this case the `D:\easyeda-extension` folder, and execute `cd "D:\easyeda-extension"`:

    ![PowerShell cd](/storage/images/en/api/guide/how-to-start/how-to-start_20240802_154933.png)

    ::: tip

    The double quotes `""` here cannot be omitted when the path contains `spaces`.

    :::

4. Depending on your network environment, execute one of the following commands:

    ```shell
    git clone --depth=1 https://github.com/easyeda/pro-api-sdk.git
    ```

### V. Get VS Code Extension

1. First you need to start VS Code and open the folder of the project you pulled in the previous stage inside it (e.g. `D:\easyeda-extension\pro-api-sdk`).

    ![VS Code Open Folder](/storage/images/en/api/guide/how-to-start/how-to-start_20240802_155144.png)

2. Then switch to the Extensions page (shortcut <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>X</kbd>) and search for and install the following apps in the search box at the top:

    1. `Code Spell Checker` by Street Side Software
    2. `ESLint` by Microsoft
    3. `EditorConfig for VS Code` by EditorConfig

    ![VS Code Search Extensions](/storage/images/en/api/guide/how-to-start/how-to-start_20240802_155249.png)

3. All extensions are pre-configured within the SDK and saved in their corresponding configuration files, and you don't need to do any additional configuration on them unless you understand what you're doing.

## Build the First EasyEDA Professional Extension

### I. List of Files

The SDK comes pre-configured with all the necessary components of the development environment, so you can refer to the following list of files to see what each one does:

```
├───.husky              Auto Script Directory
├───.vscode             VS Code Configuration File Directory
│   ├───extensions.json Recommended Extensions
│   └───settings.json   Extension Configuration
├───build               Extension Pack Compilation Directory
│   ├───dist            Extension Pack Compilation Result Directory
│   └───packaged.ts     Compile Scripts
├───config              ESBuild Configuration Directory
├───dist                Compilation Results Directory
├───iframe              IFrame Inline Frame Directory
├───images              Extension Preview Image Directory
│   ├───banner.png      Extension Banner Image
│   └───logo.png        Extension Logo Image
├───locales             Extended Multilingual Directory
│   ├───en.json         English Language Translation File
│   └───zh-Hans.json    Simplified Chinese Language Translation File
├───node_modules        NPM Dependency Module Directory
├───src                 Extension's Main Source Code Directory
├───.edaignore          EDA Ignore File Configuration
├───.editorconfig       Editor Base Format Configuration
├───.eslintrc.js        ESLint Automatic Code Constraint Configuration
├───.gitattributes      Git Attribute Configuration
├───.gitignore          Git Ignores File Configuration
├───.prettierignore     Prettier Ignores File Configuration
├───.prettierrc.js      Prettier Auto Format Configuration
├───LICENSE             Open Source License
├───README.md           Project Introduction
├───extension.json      EasyEDA Professional Extension Configuration
├───package.json        NPM Package Configuration
├───package-lock.json   NPM Package Dependency Locking Configuration
└───tsconfig.json       TypeScript Compilation Configuration
```

### II. Extension Configuration

EasyEDA Professional has a custom configuration file, i.e. `extension.json` file in the root directory of the SDK, the contents of which will be fully read by EasyEDA Professional and will be shown in the display and running process of the extension package, the following is the default contents of this file:

<<< @/private/pro-api-sdk/extension.json{2,4-5,7,11 json}

Now, we only need to change a few of the key values:

| Property    | Type     | Example                                                 | Description                                                                                 |
| ----------- | -------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| name        | `string` | `run-api-gateway`                                       | Extension name. It can only contain lowercase English letters `a-z`, digits `0-9`, and hyphens `-`, and must be `5-30` characters long. |
| displayName | `string` | `Run API Gateway`                                       | Display name. It can be in Chinese.                                                        |
| description | `string` | `Provides WebSocket gateway bridging for AI coding tools` | Description.                                                                                |
| publisher   | `string` | `JLCEDA`                                                | Developer information.                                                                      |
| license     | `string` | `Apache-2.0`                                            | Open-source licensing terms. It is recommended to go to [Choose a License](https://choosealicense.com/) to select the appropriate open source license for your project. |

### III. Initialization Environment

Initializing the environment and starting the build are very simple single commands, in order to execute these commands you first need to start a VS Code terminal:

![New VS Code Terminal](/storage/images/en/api/guide/how-to-start/how-to-start_20240802_155359.png)

The terminal will appear below by default, and you can execute all the next commands from within the terminal. Now, we need to initialize the environment for the SDK project, including installing all the dependent libraries, initializing the runtime hooks, and more things that can be automated, and you'll need to execute the following commands from within the terminal:

```shell
npm install
```

::: tip

If you encounter an error like this:

```
File C:\example.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
```

You need to run the following command in PowerShell with administrator privileges:

```powershell
Set-ExecutionPolicy RemoteSigned
```

This changes the execution policy to allow script execution. It is required to run NPM via Node.js on the device, but be aware that changing the execution policy may affect the security of the system.

If you are developing within an organization, you may need to consult your IT department, because the organization may have its own security policies.

:::

### IV. Modify the Code File

In the default environment provided by the SDK, your entry code file is `/src/index.ts`.

If the file has the same suffix, we highly recommend and support writing EasyEDA Pro extensions in TypeScript by default, relying on the type system provided by TypeScript and our [pro-api-types](https://www.npmjs.com/package/@jlceda/pro-api-types) type definition file, you can easily get complete support for type inference and syntax hints.

::: info

If you still want to code in native JavaScript, you can rename `/src/index.ts` to `/src/index.js` and remove anything inside that doesn't conform to JavaScript syntax.

:::

### V. Build

After each code change, you should perform a build to get the latest extension package, and you may need to change the version number within the `extension.json` file before doing the build:

| Property | Type     | Description                                      |
| -------- | -------- | ------------------------------------------------ |
| version  | `string` | Semantic version number in `major.minor.patch` format |

Then, execute the following command in the terminal to build the extension package:

```shell
npm run build
```

The extension packages you build will be generated in the `/build/dist/` directory.

::: tip

The build will read the `.edaignore` file in the root directory, which controls what will be excluded from the package at build time, and has the same syntax as `.gitignore`.

:::

## Import Extensions to EasyEDA Pro

The import operation currently has a different location:

### EasyEDA Pro V2

**Top Menu Bar** -\> **Settings** -\> **Extensions** -\> **Extension Manager...** -\> **Import Extensions**

![](/storage/images/cn/api/guide/how-to-start/how-to-start_20260209_133454.png)

Import the `.eext` file you generated in the `/build/dist/` directory during the last build.

### EasyEDA Pro V3

**Top Menu Bar** -\> **Advanced** -\> **Extension Manager...** -\> **Import**

![](/storage/images/cn/api/guide/how-to-start/how-to-start_20260209_133418.png)

Import the `.eext` file you generated in the `/build/dist/` directory during the last build.

<script setup>
    import { onMounted } from 'vue'
    onMounted(() => {
        document.getElementById('generatedUuid').innerHTML = crypto.randomUUID().replaceAll('-', '');
    })
</script>


path: guide/i18n.md
content: # Multi-language Support

## Multi-language Configuration

The extension supports multi-language configuration, you can create a `<IANA Language Tags>.json` file in the `./locales/` folder, you can create a `<IANA language tag>.json` file, which will be automatically associated with the corresponding language and called when appropriate.

::: code-group

```json [zh-Hans.json]
{
	"Enter": "确定",
	"Cancel": "取消"
}
```

```json [en.json]
{
	"Enter": "Enter",
	"Cancel": "Cancel"
}
```

:::

If you need to get all the language labels supported by the current extension, you can call the [SYS_I18n.getAllSupportedLanguages()](../reference/pro-api.sys_i18n.getallsupportedlanguages) method, which will return an array of strings.

::: warning

Note that if your extension has two or more languages, it must include at least one of `en` or `zh-Hans` as a fallback language, otherwise you may encounter unexpected display errors.

:::

## Use of Multiple Languages within the Code

To use a multilingual system to display different text in different language environments, use the [SYS_I18n.text()](../reference/pro-api.sys_i18n.text) method.

[SYS_I18n.text()](../reference/pro-api.sys_i18n.text) method has a mandatory argument `tag`, which corresponds to the key name in the multilingual file, and the key value matched by that key name is the final displayed text.

You can specify the `namespace` parameter as the `uuid` of other extensions to call the multilingual configuration of other extensions.

Currently, EasyEDA Professional only supports a few languages by default, while the extension API supports a lot of additional languages, you can use the `language` parameter to adapt more languages for your extension, but you need to design your own logic and method to switch languages.

When translating a language, it is very likely that we will encounter a situation where we need to embed parameters into the text, because the syntax of each language is different and the position of the parameters in the text of the language may vary greatly, you can use a placeholder in the `${1}` format to indicate the parameters that need to be embedded and pass the parameters into the `arg` of the [SYS_I18n.text()](../reference/pro-api.sys_i18n.text) method within `arg`, so that when the specified text is displayed, the corresponding argument will be embedded in the text at the specified location.

::: tip

Language priority: current display language > system default language > the first language in the dataset that contains the text tag > text label (tag)

In addition to the above steps, you may need to know other [SYS_I18n](../reference/pro-api.sys_i18n) APIs to work more freely with multilingual content.

:::

## Translating Fields in extension.json

If you need to translate fields in `extension.json`, create a `<IANA language tag>.json` file in the `./locales/extensionJson/` folder.

Within that file, each `key` must be a `value` from `extension.json`, and each `value` in the translation file is the translated result.


path: guide/index.md
content: # What is Extension API?

EasyEDA Professional Extension API (hereinafter referred to as "Extension API") is a set of JS API interfaces built on the front-end, which is used to develop various custom functions of EasyEDA Professional Editor. In short, the Extension API uses the basic syntax of JavaScript to write source code that highly encapsulates many EasyEDA Pro features and algorithms, together with a comprehensive [SDK](./ancillary-projects/pro-api-sdk), [type constraints](./ancillary-projects/pro-api-types), the development of custom extensions can be completed with very little effort, effectively reducing the mental burden on developers and designers.

Next, you can go to the [How to Get Started](./how-to-start) section to learn how to install the environment from scratch and build your own EasyEDA Pro Edition extension.

If you are an extension user, see the [Getting and Using Extensions](../user-guide/using-extension) section.


path: guide/inline-frame.md
content: # Inline Frame Support

In some application scenarios where extensions want to have fully customized windows that are not limited to the popups and controls provided by EasyEDA, we provide a way to build windows using inline frames.

To use inline frames, you need to save all files in the extension's `/iframe/` directory and use [SYS_IFrame.openIFrame()](../reference/pro-api.sys_iframe.openiframe) method to load the specified `html` file as the content of the inline frame.

```typescript
// This example loads the index.html file in the /iframe/ directory with a window of 500px in height and width
eda.sys_IFrame.openIFrame('/iframe/index.html', 500, 500);
```

::: tip
Files can be loaded and indexed without being stored in the `/iframe/` directory, but it is recommended that the `/iframe/` directory be used as the storage directory for inline frame files for a more intuitive organization of the files.

The URI referred to by the `htmlFileName` parameter starts at the root path of the extension package, you can use `/` or start directly with the `iframe/` folder name.
:::

The extension API will automatically read the specified `html` file and other files associated with it, but will not continue to recursively parse it, due to the limitations of our secure resource access rules.

To open multiple IFrame windows within a single extension, specify an ID for each IFrame.


path: guide/invoke-apis.md
content: # Invoking the Extension API

## Invoke Method

There are many classes under the EasyEDA Pro Extension API module, all **Classes**, **Enumerations**, **Interfaces**, **Type Aliases** are registered under the `EDA` base class by default and have been instantiated as [eda](../reference/pro-api.eda) object exists in the root scope of every extension runtime, and you can access it directly through the `eda` object.

All extension's runtime get a separate `eda` object, which is not shared with other extensions. You can output this object on the console in [Debug Mode](#Entering%20Debug%20Mode) within an extension (or in [Standalone Script](#Debug%20with%20Standalone%20Scripting)) using the following code:

```javascript
console.log('[DEBUG] eda:', eda);
```

Standard extension API calls require the splice **eda** + **class instance object name** + **method name / variable name**. The object names corresponding to classes instantiated in the system are in the form of the first three letters of the underscore in lowercase, for example:

| Class Name       | Class Instance Object Name |
| ---------------- | -------------------------- |
| SYS_I18n         | sys_I18n                   |
| SYS_ToastMessage | sys_ToastMessage           |

The following example calls the `text` method under the `SYS_I18n` class and the `showMessage` method under the `SYS_ToastMessage` class:

```typescript {2}
// Note that the `sys` in `sys_I18n` is lowercase because we need to use the object name when calling the
eda.sys_ToastMessage.showMessage(eda.sys_I18n.text('Done'), ESYS_ToastMessageType.INFO);

const t = eda.sys_I18n.text; // Assign `eda.sys_I18n.text` method to `t`
eda.sys_ToastMessage.showMessage(t('Done'), ESYS_ToastMessageType.INFO); // This will give you exactly the same result as line 2
```

## Commissioning Methods

### Entering Debug Mode

You can add the `cll=debug` parameter within the URL of the EasyEDA Pro editor to enter debug mode:

```diff
- https://pro.easyeda.com/editor
+ https://pro.easyeda.com/editor?cll=debug
```

Then press <kbd>F12</kbd> three times in quick succession to open the developer tools. Switch to the Console tab to output debugging information.

::: tip

If you are using the desktop client, you can press <kbd>F12</kbd> three times in quick succession to open the developer tools, then enter the following in the console:

```javascript
window.location.href = 'https://client/editor?cll=debug';
```

Then you can enter debug mode.

:::

### Debugging with Standalone Scripting

When using the extension API interface, you need to compile the changes first and upload the compiled result to EasyEDA before you can see the result. If you have some logic that you want to split out for debugging, you can try using the standalone script feature.

**V2 Debugging:**

Entry: **Top Menu** -\> **Settings** -\> **Extensions** -\> **Standalone Script**

![](/storage/images/en/api/guide/invoke-apis/invoke-apis_20250322_142403.jpg)

**V3 Debugging:**

Entry: **Top Menu** -\> **Advanced** -\> **Run Script**

![](/storage/images/cn/api/guide/invoke-apis/invoke-apis_20260312_101848.png)

You can use Script Manager to save standalone scripts and run them quickly:

![](/storage/images/cn/api/guide/invoke-apis/invoke-apis_20260312_102007.png)

Standalone scripts get a unique, throw-away `eda` object each time they run, so you don't have to worry about contaminating the runtime environment with the results of previous runs. Note, however, that some of the extension API interfaces, such as `SYS_IFrame`, cannot be called from within a standalone script because they use features from extension packages or external interactions.

The standalone script's save feature stores data in the browser's [LocalStorage](https://developer.mozilla.org/docs/Web/API/Window/localStorage) or [IndexedDB](https://developer.mozilla.org/docs/Web/API/IndexedDB_API), which is generally sustainable locally, but please note that this is always insecure, so please backup your own standalone scripts.


path: guide/stability.md
content: # Interface Stabilization

Our priority in maintaining the extension API is efficient abstraction and interface stability. It's important for users that extensions don't fail to work on a regular basis, and this is especially true and important considering that EasyEDA is currently a rapidly evolving product.

On the other hand, we also want to strike the right balance between delivering new features quickly and maintaining backward compatibility, and here's how we intend to do that.

## API Version Control

Changes to the extension API will be identified as `major.minor.patch`. `major` indicates a major version, `minor` indicates a minor version, and `patch` indicates a fix.

### Major Version

::: info
The EasyEDA Professional Edition Extension API has its own release version number, which is not equivalent to the EasyEDA version number. In general, major updates to the Extension API will follow the major or minor releases of EasyEDA.
:::

Changes to existing APIs that will be made available as major releases may have a noticeable impact on extensions and require the authors of extensions that utilize those APIs to update their code.

This includes changes to the API itself (e.g., removing deprecated methods) or changes to API behavior.

Extensions are not automatically upgraded to these versions, and in order to keep existing extensions working, the EasyEDA Professional API development team is committed to extending the lifecycle of deprecated methods as long as possible.

### Minor Version

New API interfaces and bug fixes will be provided as minor releases, and these new APIs will automatically be available to extensions as soon as they are run in the latest version of EasyEDA.

If there are bugs in the API, we may, at our discretion, release bug fixes as a minor update, depending on whether we feel that certain extensions may break as a result of fixing the bugs. While any change in API behavior could theoretically make extensions work improperly, it would incur a lot of unnecessary additional overhead for extension authors and us to treat every bug fix as a major change.

### Patch

We release a fix update when we fix an urgent new issue, make a minimal change to the API, or even just change the content of the documentation.

We may change the API's TypeScript type definition in the form of a break in the fix update. In the TypeScript world, Type and Script are two different things. As such, changes to Type do not affect existing code or cause breaks in released extensions, and having types that accurately represent the latest state of the API is more important than having perfect backward compatibility because types are easy to update. Typically, type changes only involve renaming certain types.

## APIs for the Development Phase

Development-stage APIs are APIs that are only available when the extension is set to a development version, which allows extension developers to try out new APIs and provide feedback to the EasyEDA Professional Extension API development team on whether the APIs are meeting usage requirements and/or working in any unexpected ways. APIs in development will be prominently identified within the documentation.


path: package-lock.json
content: {
  "name": "easyeda-api-skill",
  "version": "1.1.3",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "easyeda-api-skill",
      "version": "1.1.3",
      "dependencies": {
        "ws": "^8.18.0"
      },
      "devDependencies": {
        "@types/ws": "^8.5.13"
      }
    },
    "node_modules/@types/node": {
      "version": "25.5.0",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz",
      "integrity": [REDACTED_SECRET],
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "undici-types": "~7.18.0"
      }
    },
    "node_modules/@types/ws": {
      "version": "8.18.1",
      "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
      "integrity": [REDACTED_SECRET],
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/node": "*"
      }
    },
    "node_modules/undici-types": {
      "version": "7.18.2",
      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
      "integrity": [REDACTED_SECRET],
      "dev": true,
      "license": "MIT"
    },
    "node_modules/ws": {
      "version": "8.19.0",
      "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=10.0.0"
      },
      "peerDependencies": {
        "bufferutil": "^4.0.1",
        "utf-8-validate": ">=5.0.2"
      },
      "peerDependenciesMeta": {
        "bufferutil": {
          "optional": true
        },
        "utf-8-validate": {
          "optional": true
        }
      }
    }
  }
}


path: package.json
content: {
  "name": "easyeda-api",
  "version": "1.1.3",
  "description": "EasyEDA Pro API Skill — WebSocket bridge & API reference",
  "type": "module",
  "scripts": {
    "server": "node scripts/bridge-server.mjs"
  },
  "dependencies": {
    "ws": "^8.18.0"
  }
}


path: references/_index.md
content: # EasyEDA Pro API 文档索引

> 此文档由构建脚本自动生成，供 AI 编程工具使用。
> 全局变量 `eda` 是 EDA 类的实例，所有 API 通过 `eda.xxx` 调用。

## 快速导航

- [classes/](classes/) - 类文档（包含全部方法和属性）
- [enums/](enums/) - 枚举文档
- [interfaces/](interfaces/) - 接口文档（包含全部属性）
- [types/](types/) - 类型别名文档

## API 访问方式

所有 API 通过全局变量 `eda` 访问，例如：
- `eda.dmt_Board.createBoard()` — 文档树 / 板子管理
- `eda.pcb_PrimitiveLine.create()` — PCB 直线图元创建
- `eda.sys_WebSocket.register()` — WebSocket 连接注册
- `eda.sch_PrimitiveComponent.create()` — 原理图器件创建

---

# 类 (Classes)

| 类名 | 描述 | 备注 |
|------|------|------|
| [DMT_Board](classes/DMT_Board.md) | 文档树 / 板子管理类 |  |
| [DMT_EditorControl](classes/DMT_EditorControl.md) | 文档树 / 编辑器控制类 |  |
| [DMT_Folder](classes/DMT_Folder.md) | 文档树 / 文件夹类 |  |
| [DMT_Panel](classes/DMT_Panel.md) | 文档树 / 面板管理类 |  |
| [DMT_Pcb](classes/DMT_Pcb.md) | 文档树 / PCB 管理类 |  |
| [DMT_Project](classes/DMT_Project.md) | 文档树 / 工程管理类 |  |
| [DMT_Schematic](classes/DMT_Schematic.md) | 文档树 / 原理图管理类 |  |
| [DMT_SelectControl](classes/DMT_SelectControl.md) | 文档树 / 选择控制类 |  |
| [DMT_Team](classes/DMT_Team.md) | 文档树 / 团队类 |  |
| [DMT_Workspace](classes/DMT_Workspace.md) | 文档树 / 工作区类 |  |
| [EDA](classes/EDA.md) | 嘉立创 EDA 专业版用户 API 接口 |  |
| [IPCB_ComplexPolygon](classes/IPCB_ComplexPolygon.md) | 复杂多边形 |  |
| [IPCB_Polygon](classes/IPCB_Polygon.md) | 单多边形 |  |
| [IPCB_PrimitiveArc](classes/IPCB_PrimitiveArc.md) | 圆弧线图元 |  |
| [IPCB_PrimitiveAttribute](classes/IPCB_PrimitiveAttribute.md) | 属性图元 |  |
| [IPCB_PrimitiveComponent](classes/IPCB_PrimitiveComponent.md) | 器件图元 |  |
| [IPCB_PrimitiveComponentPad](classes/IPCB_PrimitiveComponentPad.md) | 器件焊盘图元 |  |
| [IPCB_PrimitiveDimension](classes/IPCB_PrimitiveDimension.md) | 尺寸标注图元 |  |
| [IPCB_PrimitiveFill](classes/IPCB_PrimitiveFill.md) | 填充图元 |  |
| [IPCB_PrimitiveImage](classes/IPCB_PrimitiveImage.md) | 图像图元 |  |
| [IPCB_PrimitiveLine](classes/IPCB_PrimitiveLine.md) | 直线图元 |  |
| [IPCB_PrimitiveObject](classes/IPCB_PrimitiveObject.md) | 二进制内嵌对象图元 |  |
| [IPCB_PrimitivePad](classes/IPCB_PrimitivePad.md) | 焊盘图元 |  |
| [IPCB_PrimitivePolyline](classes/IPCB_PrimitivePolyline.md) | 折线图元 |  |
| [IPCB_PrimitivePour](classes/IPCB_PrimitivePour.md) | 覆铜边框图元 |  |
| [IPCB_PrimitivePoured](classes/IPCB_PrimitivePoured.md) | 覆铜填充图元 |  |
| [IPCB_PrimitiveRegion](classes/IPCB_PrimitiveRegion.md) | 区域图元 |  |
| [IPCB_PrimitiveString](classes/IPCB_PrimitiveString.md) | 文本图元 |  |
| [IPCB_PrimitiveVia](classes/IPCB_PrimitiveVia.md) | 过孔图元 |  |
| [ISCH_PrimitiveArc](classes/ISCH_PrimitiveArc.md) | 圆弧图元 |  |
| [ISCH_PrimitiveAttribute](classes/ISCH_PrimitiveAttribute.md) | 属性图元 |  |
| [ISCH_PrimitiveBus](classes/ISCH_PrimitiveBus.md) | 总线图元 |  |
| [ISCH_PrimitiveCbbSymbolComponent](classes/ISCH_PrimitiveCbbSymbolComponent.md) | 复用模块符号图元 |  |
| [ISCH_PrimitiveCircle](classes/ISCH_PrimitiveCircle.md) | 圆图元 |  |
| [ISCH_PrimitiveComponent](classes/ISCH_PrimitiveComponent.md) | 器件图元 |  |
| [ISCH_PrimitiveComponentPin](classes/ISCH_PrimitiveComponentPin.md) | 器件引脚图元 |  |
| [ISCH_PrimitivePin](classes/ISCH_PrimitivePin.md) | 引脚图元 |  |
| [ISCH_PrimitivePolygon](classes/ISCH_PrimitivePolygon.md) | 多边形（折线）图元 |  |
| [ISCH_PrimitiveRectangle](classes/ISCH_PrimitiveRectangle.md) | 矩形图元 |  |
| [ISCH_PrimitiveText](classes/ISCH_PrimitiveText.md) | 文本图元 |  |
| [ISCH_PrimitiveWire](classes/ISCH_PrimitiveWire.md) | 导线图元 |  |
| [LIB_3DModel](classes/LIB_3DModel.md) | 综合库 / 3D 模型类 |  |
| [LIB_Cbb](classes/LIB_Cbb.md) | 综合库 / 复用模块类 |  |
| [LIB_Classification](classes/LIB_Classification.md) | 综合库 / 库分类索引类 |  |
| [LIB_Device](classes/LIB_Device.md) | 综合库 / 器件类 |  |
| [LIB_Footprint](classes/LIB_Footprint.md) | 综合库 / 封装类 |  |
| [LIB_LibrariesList](classes/LIB_LibrariesList.md) | 综合库 / 库列表类 |  |
| [LIB_PanelLibrary](classes/LIB_PanelLibrary.md) | 综合库 / 面板库类 |  |
| [LIB_SelectControl](classes/LIB_SelectControl.md) | 综合库 / 选择控制类 |  |
| [LIB_Symbol](classes/LIB_Symbol.md) | 综合库 / 符号类 |  |
| [PCB_Document](classes/PCB_Document.md) | PCB &amp; 封装 / 文档操作类 |  |
| [PCB_Drc](classes/PCB_Drc.md) | PCB &amp; 封装 / 设计规则检查（DRC）类 |  |
| [PCB_Event](classes/PCB_Event.md) | PCB &amp; 封装 / 事件类 |  |
| [PCB_Layer](classes/PCB_Layer.md) | PCB &amp; 封装 / 图层操作类 |  |
| [PCB_ManufactureData](classes/PCB_ManufactureData.md) | PCB &amp; 封装 / 生产资料类 |  |
| [PCB_MathPolygon](classes/PCB_MathPolygon.md) | PCB &amp; 封装 / 多边形数学类 |  |
| [PCB_Net](classes/PCB_Net.md) | PCB &amp; 封装 / 网络类 |  |
| [PCB_Primitive](classes/PCB_Primitive.md) | PCB &amp; 封装 / 图元类 |  |
| [PCB_PrimitiveArc](classes/PCB_PrimitiveArc.md) | PCB &amp; 封装 / 圆弧线图元类 |  |
| [PCB_PrimitiveAttribute](classes/PCB_PrimitiveAttribute.md) | PCB &amp; 封装 / 属性图元类 |  |
| [PCB_PrimitiveComponent](classes/PCB_PrimitiveComponent.md) | PCB &amp; 封装 / 器件图元类 |  |
| [PCB_PrimitiveDimension](classes/PCB_PrimitiveDimension.md) | PCB &amp; 封装 / 尺寸标注图元类 |  |
| [PCB_PrimitiveFill](classes/PCB_PrimitiveFill.md) | PCB &amp; 封装 / 填充图元类 |  |
| [PCB_PrimitiveImage](classes/PCB_PrimitiveImage.md) | PCB &amp; 封装 / 图像图元类 |  |
| [PCB_PrimitiveLine](classes/PCB_PrimitiveLine.md) | PCB &amp; 封装 / 直线图元类 |  |
| [PCB_PrimitiveObject](classes/PCB_PrimitiveObject.md) | PCB &amp; 封装 / 二进制内嵌对象图元类 |  |
| [PCB_PrimitivePad](classes/PCB_PrimitivePad.md) | PCB &amp; 封装 / 焊盘图元类 |  |
| [PCB_PrimitivePolyline](classes/PCB_PrimitivePolyline.md) | PCB &amp; 封装 / 折线图元类 |  |
| [PCB_PrimitivePour](classes/PCB_PrimitivePour.md) | PCB &amp; 封装 / 覆铜边框图元类 |  |
| [PCB_PrimitivePoured](classes/PCB_PrimitivePoured.md) | PCB &amp; 封装 / 覆铜填充图元类 |  |
| [PCB_PrimitiveRegion](classes/PCB_PrimitiveRegion.md) | PCB &amp; 封装 / 禁止区域和约束区域图元类 |  |
| [PCB_PrimitiveString](classes/PCB_PrimitiveString.md) | PCB &amp; 封装 / 文本图元类 |  |
| [PCB_PrimitiveVia](classes/PCB_PrimitiveVia.md) | PCB &amp; 封装 / 过孔图元类 |  |
| [PCB_RayTracerEngine](classes/PCB_RayTracerEngine.md) | PCB &amp; 封装 / 光线追踪引擎类 |  |
| [PCB_SelectControl](classes/PCB_SelectControl.md) | PCB &amp; 封装 / 选择控制类 |  |
| [PNL_Document](classes/PNL_Document.md) | 面板 / 文档操作类 |  |
| [SCH_Document](classes/SCH_Document.md) | 原理图 &amp; 符号 / 文档操作类 |  |
| [SCH_Drc](classes/SCH_Drc.md) | 原理图 &amp; 符号 / 设计规则检查（DRC）类 |  |
| [SCH_Event](classes/SCH_Event.md) | 原理图 &amp; 符号 / 事件类 |  |
| [SCH_ManufactureData](classes/SCH_ManufactureData.md) | 原理图 &amp; 符号 / 生产资料类 |  |
| [SCH_Net](classes/SCH_Net.md) | 原理图 &amp; 符号 / 网络类 |  |
| [SCH_Netlist](classes/SCH_Netlist.md) | 原理图 &amp; 符号 / 网表类 |  |
| [SCH_Primitive](classes/SCH_Primitive.md) | 原理图 &amp; 符号 / 图元类 |  |
| [SCH_PrimitiveArc](classes/SCH_PrimitiveArc.md) | 原理图 &amp; 符号 / 圆弧图元类 |  |
| [SCH_PrimitiveAttribute](classes/SCH_PrimitiveAttribute.md) | 原理图 &amp; 符号 / 属性图元类 |  |
| [SCH_PrimitiveBus](classes/SCH_PrimitiveBus.md) | 原理图 &amp; 符号 / 总线图元类 |  |
| [SCH_PrimitiveCircle](classes/SCH_PrimitiveCircle.md) | 原理图 &amp; 符号 / 圆图元类 |  |
| [SCH_PrimitiveComponent](classes/SCH_PrimitiveComponent.md) | 原理图 &amp; 符号 / 器件图元类 |  |
| [SCH_PrimitiveObject](classes/SCH_PrimitiveObject.md) | 原理图 &amp; 符号 / 二进制内嵌对象图元类 |  |
| [SCH_PrimitivePin](classes/SCH_PrimitivePin.md) | 原理图 &amp; 符号 / 引脚图元类 |  |
| [SCH_PrimitivePolygon](classes/SCH_PrimitivePolygon.md) | 原理图 &amp; 符号 / 多边形（折线）图元类 |  |
| [SCH_PrimitiveRectangle](classes/SCH_PrimitiveRectangle.md) | 原理图 &amp; 符号 / 矩形图元类 |  |
| [SCH_PrimitiveText](classes/SCH_PrimitiveText.md) | 原理图 &amp; 符号 / 文本图元类 |  |
| [SCH_PrimitiveWire](classes/SCH_PrimitiveWire.md) | 原理图 &amp; 符号 / 导线图元类 |  |
| [SCH_SelectControl](classes/SCH_SelectControl.md) | 原理图 &amp; 符号 / 选择控制类 |  |
| [SCH_SimulationEngine](classes/SCH_SimulationEngine.md) | 原理图 &amp; 符号 / 仿真引擎类 |  |
| [SCH_Utils](classes/SCH_Utils.md) | 原理图 &amp; 符号 / 工具类 |  |
| [SYS_ClientUrl](classes/SYS_ClientUrl.md) | 系统 / 外部请求类 |  |
| [SYS_Dialog](classes/SYS_Dialog.md) | 系统 / 对话框类 |  |
| [SYS_Environment](classes/SYS_Environment.md) | 系统 / 运行环境类 |  |
| [SYS_FileManager](classes/SYS_FileManager.md) | 系统 / 文件管理类 |  |
| [SYS_FileSystem](classes/SYS_FileSystem.md) | 系统 / 文件系统交互类 |  |
| [SYS_FontManager](classes/SYS_FontManager.md) | 系统 / 字体管理类 |  |
| [SYS_FormatConversion](classes/SYS_FormatConversion.md) | 系统 / 格式转换（Chameleon）类 |  |
| [SYS_HeaderMenu](classes/SYS_HeaderMenu.md) | 系统 / 顶部菜单类 |  |
| [SYS_I18n](classes/SYS_I18n.md) | 系统 / 多语言类 |  |
| [SYS_IFrame](classes/SYS_IFrame.md) | 系统 / 内联框架窗口类 |  |
| [SYS_LoadingAndProgressBar](classes/SYS_LoadingAndProgressBar.md) | 系统 / 加载与进度条类 |  |
| [SYS_Log](classes/SYS_Log.md) | 系统 / 日志类 |  |
| [SYS_Message](classes/SYS_Message.md) | 系统 / 消息通知类 |  |
| [SYS_MessageBox](classes/SYS_MessageBox.md) | 系统 / 消息框类 |  |
| [SYS_MessageBus](classes/SYS_MessageBus.md) | 系统 / 消息总线类 |  |
| [SYS_PanelControl](classes/SYS_PanelControl.md) | 系统 / 面板控制类 |  |
| [SYS_RightClickMenu](classes/SYS_RightClickMenu.md) | 系统 / 右键菜单类 |  |
| [SYS_Setting](classes/SYS_Setting.md) | 系统 / 设置类 |  |
| [SYS_ShortcutKey](classes/SYS_ShortcutKey.md) | 系统 / 快捷键类 |  |
| [SYS_Storage](classes/SYS_Storage.md) | 系统 / 存储类 |  |
| [SYS_Timer](classes/SYS_Timer.md) | 系统 / 定时器类 |  |
| [SYS_ToastMessage](classes/SYS_ToastMessage.md) | 系统 / 吐司消息类 |  |
| [SYS_Tool](classes/SYS_Tool.md) | 系统 / 工具类 |  |
| [SYS_Unit](classes/SYS_Unit.md) | 系统 / 单位类 |  |
| [SYS_WebSocket](classes/SYS_WebSocket.md) | 系统 / WebSocket 类 |  |
| [SYS_Window](classes/SYS_Window.md) | 系统 / 窗口类 |  |


---

# 枚举 (Enumerations)

| 枚举名 | 描述 | 备注 |
|--------|------|------|
| [EDMT_EditorDocumentType](enums/EDMT_EditorDocumentType.md) | 编辑器文档类型 |  |
| [EDMT_EditorSplitScreenDirection](enums/EDMT_EditorSplitScreenDirection.md) | 编辑器分屏方向 |  |
| [EDMT_IndicatorMarkerType](enums/EDMT_IndicatorMarkerType.md) | 指示标记类型 |  |
| [EDMT_ItemType](enums/EDMT_ItemType.md) | 文档树项目类型 |  |
| [EDMT_ProjectCollaborationMode](enums/EDMT_ProjectCollaborationMode.md) | 工程协作模式 |  |
| [ELIB_DeviceJlcLibraryCategory](enums/ELIB_DeviceJlcLibraryCategory.md) | 嘉立创贴片库类别 |  |
| [ELIB_LibraryType](enums/ELIB_LibraryType.md) | 综合库库类型 |  |
| [ELIB_PreviewType](enums/ELIB_PreviewType.md) | 预览视图类型 |  |
| [ELIB_SymbolType](enums/ELIB_SymbolType.md) | 符号类型 |  |
| [EPCB_DocumentRatlineCalculatingActiveStatus](enums/EPCB_DocumentRatlineCalculatingActiveStatus.md) | 文档飞线计算功能状态 |  |
| [EPCB_InactiveLayerDisplayMode](enums/EPCB_InactiveLayerDisplayMode.md) | 非激活层展示模式 |  |
| [EPCB_LayerColorConfiguration](enums/EPCB_LayerColorConfiguration.md) | 图层颜色配置 |  |
| [EPCB_LayerId](enums/EPCB_LayerId.md) | 图层 ID |  |
| [EPCB_LayerStatus](enums/EPCB_LayerStatus.md) | 层状态 |  |
| [EPCB_LayerType](enums/EPCB_LayerType.md) | 图层类型 |  |
| [EPCB_PcbPlateType](enums/EPCB_PcbPlateType.md) | PCB 板材类型 |  |
| [EPCB_PdfOutputMethod](enums/EPCB_PdfOutputMethod.md) | PDF 输出方式 |  |
| [EPCB_PrimitiveArcInteractiveMode](enums/EPCB_PrimitiveArcInteractiveMode.md) | 圆弧交互模式 |  |
| [EPCB_PrimitiveDimensionType](enums/EPCB_PrimitiveDimensionType.md) | 尺寸标注类型 |  |
| [EPCB_PrimitiveFillMode](enums/EPCB_PrimitiveFillMode.md) | 填充图元填充模式 |  |
| [EPCB_PrimitivePadHeatWeldingConnectionMethod](enums/EPCB_PrimitivePadHeatWeldingConnectionMethod.md) | 焊盘热焊连接方式 |  |
| [EPCB_PrimitivePadHoleType](enums/EPCB_PrimitivePadHoleType.md) | 焊盘钻孔类型 |  |
| [EPCB_PrimitivePadShapeType](enums/EPCB_PrimitivePadShapeType.md) | 焊盘外形种类 |  |
| [EPCB_PrimitivePadType](enums/EPCB_PrimitivePadType.md) | 焊盘类型 |  |
| [EPCB_PrimitivePourFillMethod](enums/EPCB_PrimitivePourFillMethod.md) | 覆铜填充方法 |  |
| [EPCB_PrimitiveRegionRuleType](enums/EPCB_PrimitiveRegionRuleType.md) | 区域图元区域规则类型 |  |
| [EPCB_PrimitiveStringAlignMode](enums/EPCB_PrimitiveStringAlignMode.md) | 文本对齐模式 |  |
| [EPCB_PrimitiveType](enums/EPCB_PrimitiveType.md) | 图元类型 |  |
| [EPCB_PrimitiveViaType](enums/EPCB_PrimitiveViaType.md) | 过孔类型 |  |
| [ESCH_DynamicSimulationEnginePullEventType](enums/ESCH_DynamicSimulationEnginePullEventType.md) | 动态仿真引擎拉取事件类型 |  |
| [ESCH_DynamicSimulationEnginePushEventType](enums/ESCH_DynamicSimulationEnginePushEventType.md) | 动态仿真引擎推送事件类型 |  |
| [ESCH_ExportDocumentFileType](enums/ESCH_ExportDocumentFileType.md) | 导出文档文件类型 |  |
| [ESCH_MouseEventType](enums/ESCH_MouseEventType.md) | 鼠标事件类型 |  |
| [ESCH_PrimitiveComponentType](enums/ESCH_PrimitiveComponentType.md) | 器件类型 |  |
| [ESCH_PrimitiveEventType](enums/ESCH_PrimitiveEventType.md) | 图元事件类型 |  |
| [ESCH_PrimitiveFillStyle](enums/ESCH_PrimitiveFillStyle.md) | 填充样式 |  |
| [ESCH_PrimitiveLineType](enums/ESCH_PrimitiveLineType.md) | 线型 |  |
| [ESCH_PrimitivePinShape](enums/ESCH_PrimitivePinShape.md) | 引脚形状 |  |
| [ESCH_PrimitivePinType](enums/ESCH_PrimitivePinType.md) | 引脚类型 |  |
| [ESCH_PrimitiveTextAlignMode](enums/ESCH_PrimitiveTextAlignMode.md) | 文本对齐模式 |  |
| [ESCH_PrimitiveType](enums/ESCH_PrimitiveType.md) | 图元类型 |  |
| [ESCH_ShapeType](enums/ESCH_ShapeType.md) | 图元类型 |  |
| [ESCH_SimulationNetlistType](enums/ESCH_SimulationNetlistType.md) | 仿真网表类型 |  |
| [ESCH_SpiceSimulationEnginePullEventType](enums/ESCH_SpiceSimulationEnginePullEventType.md) | Spice 仿真引擎拉取事件类型 |  |
| [ESCH_SpiceSimulationEnginePushEventType](enums/ESCH_SpiceSimulationEnginePushEventType.md) | Spice 仿真引擎推送事件类型 |  |
| [ESYS_BottomPanelTab](enums/ESYS_BottomPanelTab.md) | 底部面板标签页 |  |
| [ESYS_HeaderMenuEnvironment](enums/ESYS_HeaderMenuEnvironment.md) | 顶部菜单环境 |  |
| [ESYS_ImportProjectBoardOutlineSource](enums/ESYS_ImportProjectBoardOutlineSource.md) | 导入工程板边框来源 |  |
| [ESYS_ImportProjectImportOption](enums/ESYS_ImportProjectImportOption.md) | 导入工程导入选项 |  |
| [ESYS_ImportProjectSchematicObjectStyle](enums/ESYS_ImportProjectSchematicObjectStyle.md) | 导入工程原理图图元样式 |  |
| [ESYS_ImportProjectViaSolderMaskExpansion](enums/ESYS_ImportProjectViaSolderMaskExpansion.md) | 导入工程过孔阻焊扩展 |  |
| [ESYS_LeftPanelTab](enums/ESYS_LeftPanelTab.md) | 左侧面板标签页 |  |
| [ESYS_LogType](enums/ESYS_LogType.md) | 日志类型 |  |
| [ESYS_NetlistType](enums/ESYS_NetlistType.md) | 网表类型 |  |
| [ESYS_RightPanelTab](enums/ESYS_RightPanelTab.md) | 右侧面板标签页 |  |
| [ESYS_ShortcutKeyEffectiveEditorDocumentType](enums/ESYS_ShortcutKeyEffectiveEditorDocumentType.md) | 快捷键生效页面范围 |  |
| [ESYS_ShortcutKeyEffectiveEditorScene](enums/ESYS_ShortcutKeyEffectiveEditorScene.md) | 快捷键生效场景范围 |  |
| [ESYS_Theme](enums/ESYS_Theme.md) | 主题 |  |
| [ESYS_ToastMessageType](enums/ESYS_ToastMessageType.md) | 吐司消息类型 |  |
| [ESYS_Unit](enums/ESYS_Unit.md) | 单位 |  |
| [ESYS_WindowEventType](enums/ESYS_WindowEventType.md) | 窗口事件类型 |  |
| [ESYS_WindowOpenTarget](enums/ESYS_WindowOpenTarget.md) | 打开窗口上下文目标 |  |


---

# 接口 (Interfaces)

| 接口名 | 描述 | 备注 |
|--------|------|------|
| [IDMT_BoardItem](interfaces/IDMT_BoardItem.md) | 板子属性 |  |
| [IDMT_BriefProjectItem](interfaces/IDMT_BriefProjectItem.md) | 简略工程属性 |  |
| [IDMT_EditorDocumentItem](interfaces/IDMT_EditorDocumentItem.md) | 编辑器文档对象 |  |
| [IDMT_EditorSplitScreenItem](interfaces/IDMT_EditorSplitScreenItem.md) | 编辑器分屏属性 |  |
| [IDMT_EditorTabItem](interfaces/IDMT_EditorTabItem.md) | 编辑器标签页 |  |
| [IDMT_FolderItem](interfaces/IDMT_FolderItem.md) | 文件夹属性 |  |
| [IDMT_IndicatorMarkerShape](interfaces/IDMT_IndicatorMarkerShape.md) | 指示标记外形 |  |
| [IDMT_PanelItem](interfaces/IDMT_PanelItem.md) | 面板属性 |  |
| [IDMT_PcbItem](interfaces/IDMT_PcbItem.md) | PCB 属性 |  |
| [IDMT_ProjectItem](interfaces/IDMT_ProjectItem.md) | 工程属性 |  |
| [IDMT_SchematicItem](interfaces/IDMT_SchematicItem.md) | 原理图属性 |  |
| [IDMT_SchematicPageItem](interfaces/IDMT_SchematicPageItem.md) | 原理图图页属性 |  |
| [IDMT_TeamItem](interfaces/IDMT_TeamItem.md) | 团队属性 |  |
| [IDMT_WorkspaceItem](interfaces/IDMT_WorkspaceItem.md) | 工作区属性 |  |
| [ILIB_3DModelItem](interfaces/ILIB_3DModelItem.md) | 3D 模型属性 |  |
| [ILIB_3DModelSearchItem](interfaces/ILIB_3DModelSearchItem.md) | 搜索到的 3D 模型属性 |  |
| [ILIB_CbbItem](interfaces/ILIB_CbbItem.md) | 复用模块属性 |  |
| [ILIB_CbbSearchItem](interfaces/ILIB_CbbSearchItem.md) | 搜索到的复用模块属性 |  |
| [ILIB_ClassificationIndex](interfaces/ILIB_ClassificationIndex.md) | 分类索引 |  |
| [ILIB_DeviceAssociationItem](interfaces/ILIB_DeviceAssociationItem.md) | 器件关联符号、封装属性 |  |
| [ILIB_DeviceExtendPropertyItem](interfaces/ILIB_DeviceExtendPropertyItem.md) | 器件扩展属性 |  |
| [ILIB_DeviceItem](interfaces/ILIB_DeviceItem.md) | 器件属性 |  |
| [ILIB_DeviceSearchItem](interfaces/ILIB_DeviceSearchItem.md) | 搜索到的器件属性 |  |
| [ILIB_ExtendLibrary3DModelFunctions](interfaces/ILIB_ExtendLibrary3DModelFunctions.md) | 外部库 3D 模型方法 |  |
| [ILIB_ExtendLibraryCbbFunctions](interfaces/ILIB_ExtendLibraryCbbFunctions.md) | 外部库复用模块方法 |  |
| [ILIB_ExtendLibraryClassificationIndex](interfaces/ILIB_ExtendLibraryClassificationIndex.md) | 外部库分类索引 |  |
| [ILIB_ExtendLibraryDeviceFunctions](interfaces/ILIB_ExtendLibraryDeviceFunctions.md) | 外部库器件方法 |  |
| [ILIB_ExtendLibraryFootprintFunctions](interfaces/ILIB_ExtendLibraryFootprintFunctions.md) | 外部库封装方法 |  |
| [ILIB_ExtendLibraryFunctions](interfaces/ILIB_ExtendLibraryFunctions.md) | 外部库方法 |  |
| [ILIB_ExtendLibraryItem](interfaces/ILIB_ExtendLibraryItem.md) | 外部库元素 |  |
| [ILIB_ExtendLibraryItemIndex](interfaces/ILIB_ExtendLibraryItemIndex.md) | 外部库元素索引 |  |
| [ILIB_ExtendLibrarySearchProperty](interfaces/ILIB_ExtendLibrarySearchProperty.md) | 外部库搜索参数 |  |
| [ILIB_ExtendLibrarySearchResult](interfaces/ILIB_ExtendLibrarySearchResult.md) | 外部库搜索结果 |  |
| [ILIB_ExtendLibrarySearchResultDataLine](interfaces/ILIB_ExtendLibrarySearchResultDataLine.md) | 外部库搜索结果数据行 |  |
| [ILIB_ExtendLibrarySymbolFunctions](interfaces/ILIB_ExtendLibrarySymbolFunctions.md) | 外部库符号方法 |  |
| [ILIB_ExtendLibraryUserIndex](interfaces/ILIB_ExtendLibraryUserIndex.md) | 外部库用户索引 |  |
| [ILIB_FootprintItem](interfaces/ILIB_FootprintItem.md) | 封装属性 |  |
| [ILIB_FootprintSearchItem](interfaces/ILIB_FootprintSearchItem.md) | 搜索到的封装属性 |  |
| [ILIB_LibraryInfo](interfaces/ILIB_LibraryInfo.md) | 库信息 |  |
| [ILIB_LibraryItem](interfaces/ILIB_LibraryItem.md) | 库属性 |  |
| [ILIB_PanelLibraryItem](interfaces/ILIB_PanelLibraryItem.md) | 面板库属性 |  |
| [ILIB_PanelLibrarySearchItem](interfaces/ILIB_PanelLibrarySearchItem.md) | 搜索到的面板库属性 |  |
| [ILIB_SymbolItem](interfaces/ILIB_SymbolItem.md) | 符号属性 |  |
| [ILIB_SymbolSearchItem](interfaces/ILIB_SymbolSearchItem.md) | 搜索到的符号属性 |  |
| [IPCB_BomPropertiesTableColumns](interfaces/IPCB_BomPropertiesTableColumns.md) | BOM 列的属性及排序规则 |  |
| [IPCB_DifferentialPairItem](interfaces/IPCB_DifferentialPairItem.md) | 差分对属性 |  |
| [IPCB_EqualLengthNetGroupItem](interfaces/IPCB_EqualLengthNetGroupItem.md) | 等长网络组属性 |  |
| [IPCB_LayerItem](interfaces/IPCB_LayerItem.md) | 图层属性 |  |
| [IPCB_NetClassItem](interfaces/IPCB_NetClassItem.md) | 网络类属性 |  |
| [IPCB_NetInfo](interfaces/IPCB_NetInfo.md) | 网络属性 |  |
| [IPCB_PadPairGroupItem](interfaces/IPCB_PadPairGroupItem.md) | 焊盘对组属性 |  |
| [IPCB_PadPairMinWireLengthItem](interfaces/IPCB_PadPairMinWireLengthItem.md) | 焊盘对最短导线长度属性 |  |
| [IPCB_Primitive](interfaces/IPCB_Primitive.md) | PCB 图元 |  |
| [IPCB_PrimitiveAPI](interfaces/IPCB_PrimitiveAPI.md) | PCB 图元接口 |  |
| [IPCB_PrimitivePouredPourFill](interfaces/IPCB_PrimitivePouredPourFill.md) | 覆铜填充区域 |  |
| [IPCB_PrimitiveSolderMaskAndPasteMaskExpansion](interfaces/IPCB_PrimitiveSolderMaskAndPasteMaskExpansion.md) | 阻焊/助焊扩展 |  |
| [ISCH_NetInfo](interfaces/ISCH_NetInfo.md) | 网络属性 |  |
| [ISCH_Primitive](interfaces/ISCH_Primitive.md) | 原理图图元 |  |
| [ISCH_PrimitiveAPI](interfaces/ISCH_PrimitiveAPI.md) | 原理图图元接口 |  |
| [ISCH_ProjectNetInfo](interfaces/ISCH_ProjectNetInfo.md) | 工程网络属性 |  |
| [ISCH_WireInfo](interfaces/ISCH_WireInfo.md) | 导线属性 |  |
| [ISYS_FileSystemFileList](interfaces/ISYS_FileSystemFileList.md) | 文件系统文件路径 |  |
| [ISYS_HeaderMenus](interfaces/ISYS_HeaderMenus.md) | 顶部菜单项 |  |
| [ISYS_HeaderMenuSub1MenuItem](interfaces/ISYS_HeaderMenuSub1MenuItem.md) | 顶部二级菜单项 |  |
| [ISYS_HeaderMenuSub2MenuItem](interfaces/ISYS_HeaderMenuSub2MenuItem.md) | 顶部三级菜单项 |  |
| [ISYS_HeaderMenuTopMenuItem](interfaces/ISYS_HeaderMenuTopMenuItem.md) | 顶部一级菜单项 |  |
| [ISYS_LanguageKeyValuePairs](interfaces/ISYS_LanguageKeyValuePairs.md) | 语言数据键值对 |  |
| [ISYS_LogLine](interfaces/ISYS_LogLine.md) | 日志行 |  |
| [ISYS_MessageBusTask](interfaces/ISYS_MessageBusTask.md) | 消息总线任务 |  |
| [ISYS_MultilingualLanguagesData](interfaces/ISYS_MultilingualLanguagesData.md) | 多语言数据 |  |
| [ISYS_ReactComponentizationDialogInterface](interfaces/ISYS_ReactComponentizationDialogInterface.md) | **_(ALPHA)_** React 组件化弹出窗口接口 |  |
| [ISYS_ReactComponentizationDialogReactInstance](interfaces/ISYS_ReactComponentizationDialogReactInstance.md) | **_(ALPHA)_** React 实例接口 用于接收扩展的 React 实例 |  |
| [ISYS_ReactComponentizationDialogReconcilerInstance](interfaces/ISYS_ReactComponentizationDialogReconcilerInstance.md) | **_(ALPHA)_** React Reconciler 实例接口 用于接收扩展的 react-reconciler 实例 |  |
| [ISYS_ReactComponentizationDialogVirtualRender](interfaces/ISYS_ReactComponentizationDialogVirtualRender.md) | **_(ALPHA)_** VirtualRender 类接口 用于在虚拟环境中渲染 React 组件 |  |
| [ISYS_ReactComponentizationDialogWorkerPortal](interfaces/ISYS_ReactComponentizationDialogWorkerPortal.md) | **_(ALPHA)_** WorkerPortal 类接口 用于管理组件的生命周期和事件处理 |  |
| [ISYS_RightClickMenuItem](interfaces/ISYS_RightClickMenuItem.md) | 右键菜单项 |  |
| [ISYS_WindowEventListenerRemovableObject](interfaces/ISYS_WindowEventListenerRemovableObject.md) | 窗口事件监听可移除对象 |  |


---

# 类型别名 (Type Aliases)

| 类型名 | 描述 | 备注 |
|--------|------|------|
| [LC_DESIGN_COMPONENTS](types/LC_DESIGN_COMPONENTS.md) |  |  |
| [TPCB_LayersInTheSelectable](types/TPCB_LayersInTheSelectable.md) | 可选中图层 |  |
| [TPCB_LayersOfComponent](types/TPCB_LayersOfComponent.md) | 器件所属层 |  |
| [TPCB_LayersOfCopper](types/TPCB_LayersOfCopper.md) | 铜箔所属层 |  |
| [TPCB_LayersOfCustom](types/TPCB_LayersOfCustom.md) | 自定义层 |  |
| [TPCB_LayersOfDimension](types/TPCB_LayersOfDimension.md) | 尺寸标注所属层 |  |
| [TPCB_LayersOfFill](types/TPCB_LayersOfFill.md) | 填充所属层 |  |
| [TPCB_LayersOfImage](types/TPCB_LayersOfImage.md) | 复杂多边形图（SVG 图像、文本）所属层 |  |
| [TPCB_LayersOfInner](types/TPCB_LayersOfInner.md) | 内层 |  |
| [TPCB_LayersOfLine](types/TPCB_LayersOfLine.md) | 线所属层 |  |
| [TPCB_LayersOfObject](types/TPCB_LayersOfObject.md) | 二进制内嵌对象所属层 |  |
| [TPCB_LayersOfPad](types/TPCB_LayersOfPad.md) | 焊盘所属层 |  |
| [TPCB_LayersOfRegion](types/TPCB_LayersOfRegion.md) | 区域所属层 |  |
| [TPCB_LayerTypesOfInnerLayer](types/TPCB_LayerTypesOfInnerLayer.md) | 内层允许设置的图层类型 |  |
| [TPCB_PolygonSourceArray](types/TPCB_PolygonSourceArray.md) | 单多边形源数组 |  |
| [TPCB_PrimitiveDimensionCoordinateSet](types/TPCB_PrimitiveDimensionCoordinateSet.md) | 尺寸标注坐标集 |  |
| [TPCB_PrimitivePadHole](types/TPCB_PrimitivePadHole.md) | 焊盘钻孔 |  |
| [TPCB_PrimitivePadShape](types/TPCB_PrimitivePadShape.md) | 焊盘外形 |  |
| [TPCB_PrimitiveSpecialPadShape](types/TPCB_PrimitiveSpecialPadShape.md) | 特殊焊盘外形 |  |
| [TSYS_ShortcutKeys](types/TSYS_ShortcutKeys.md) | 快捷键按键 |  |



path: references/classes/DMT_Board.md
content: # DMT\_Board class

文档树 / 板子管理类

## Signature

```typescript
declare class DMT_Board 
```

## Remarks

在当前打开的工程内进行板子管理的相关操作

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[copyBoard(sourceBoardName)](./DMT_Board.md)


</td><td>


</td><td>

复制板子


</td></tr>
<tr><td>

[createBoard(schematicUuid, pcbUuid)](./DMT_Board.md)


</td><td>


</td><td>

**_(BETA)_** 创建板子


</td></tr>
<tr><td>

[deleteBoard(boardName)](./DMT_Board.md)


</td><td>


</td><td>

删除板子


</td></tr>
<tr><td>

[getAllBoardsInfo()](./DMT_Board.md)


</td><td>


</td><td>

获取工程内所有板子的详细属性


</td></tr>
<tr><td>

[getBoardInfo(boardName)](./DMT_Board.md)


</td><td>


</td><td>

获取板子的详细属性


</td></tr>
<tr><td>

[getCurrentBoardInfo()](./DMT_Board.md)


</td><td>


</td><td>

获取当前板子的详细属性


</td></tr>
<tr><td>

[modifyBoardName(originalBoardName, boardName)](./DMT_Board.md)


</td><td>


</td><td>

修改板子名称


</td></tr>
</tbody></table>

---

## 方法详情

### copyboard

# DMT\_Board.copyBoard() method

复制板子

## Signature

```typescript
copyBoard(sourceBoardName: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

sourceBoardName


</td><td>

string


</td><td>

源板子名称


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

新板子名称，如若为 `undefined` 则复制失败

### createboard

# DMT\_Board.createBoard() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

创建板子

## Signature

```typescript
createBoard(schematicUuid?: string, pcbUuid?: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicUuid


</td><td>

string


</td><td>

_(Optional)_ 关联原理图 UUID


</td></tr>
<tr><td>

pcbUuid


</td><td>

string


</td><td>

_(Optional)_ 关联 PCB UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

板子名称，如若为 `undefined` 则创建失败

### deleteboard

# DMT\_Board.deleteBoard() method

删除板子

## Signature

```typescript
deleteBoard(boardName: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

boardName


</td><td>

string


</td><td>

板子名称


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

如若指定板子不存在，接口将返回 `false` 的结果，表示操作失败

### getallboardsinfo

# DMT\_Board.getAllBoardsInfo() method

获取工程内所有板子的详细属性

## Signature

```typescript
getAllBoardsInfo(): Promise<Array<IDMT_BoardItem>>;
```


## Returns

Promise&lt;Array&lt;[IDMT\_BoardItem](../interfaces/IDMT_BoardItem.md)<!-- -->&gt;&gt;

所有板子的详细属性的数组

### getboardinfo

# DMT\_Board.getBoardInfo() method

获取板子的详细属性

## Signature

```typescript
getBoardInfo(boardName: string): Promise<IDMT_BoardItem | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

boardName


</td><td>

string


</td><td>

板子名称


</td></tr>
</tbody></table>



## Returns

Promise&lt;[IDMT\_BoardItem](../interfaces/IDMT_BoardItem.md) \| undefined&gt;

板子的详细属性，如若为 `undefined` 则获取失败

### getcurrentboardinfo

# DMT\_Board.getCurrentBoardInfo() method

获取当前板子的详细属性

## Signature

```typescript
getCurrentBoardInfo(): Promise<IDMT_BoardItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_BoardItem](../interfaces/IDMT_BoardItem.md) \| undefined&gt;

板子的详细属性，如若为 `undefined` 则获取失败

## Remarks

将会获取当前打开且拥有最后输入焦点的原理图、PCB 所关联的板子的详细属性

### modifyboardname

# DMT\_Board.modifyBoardName() method

修改板子名称

## Signature

```typescript
modifyBoardName(originalBoardName: string, boardName: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

originalBoardName


</td><td>

string


</td><td>

原板子名称


</td></tr>
<tr><td>

boardName


</td><td>

string


</td><td>

新板子名称


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否修改成功


path: references/classes/DMT_EditorControl.md
content: # DMT\_EditorControl class

文档树 / 编辑器控制类

## Signature

```typescript
declare class DMT_EditorControl 
```

## Remarks

此处编辑器控制基于当前已打开的工程设计下的图页，其它任何 `documentUuid` 都将被认为是不存在的文档页

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[activateDocument(tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

激活文档


</td></tr>
<tr><td>

[activateSplitScreen(splitScreenId)](./DMT_EditorControl.md)


</td><td>


</td><td>

激活分屏


</td></tr>
<tr><td>

[closeDocument(tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

关闭文档


</td></tr>
<tr><td>

[createSplitScreen(splitScreenType, tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

创建分屏


</td></tr>
<tr><td>

[generateIndicatorMarkers(markers, color, lineWidth, zoom, tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

**_(BETA)_** 生成指示标记


</td></tr>
<tr><td>

[getCurrentRenderedAreaImage(tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

**_(BETA)_** 获取画布渲染区域图像


</td></tr>
<tr><td>

[getSplitScreenIdByTabId(tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

使用标签页 ID 获取分屏 ID


</td></tr>
<tr><td>

[getSplitScreenTree()](./DMT_EditorControl.md)


</td><td>


</td><td>

获取编辑器分屏属性树


</td></tr>
<tr><td>

[getTabsBySplitScreenId(splitScreenId)](./DMT_EditorControl.md)


</td><td>


</td><td>

获取指定分屏 ID 下的所有标签页


</td></tr>
<tr><td>

[mergeAllDocumentFromSplitScreen()](./DMT_EditorControl.md)


</td><td>


</td><td>

合并所有分屏


</td></tr>
<tr><td>

[moveDocumentToSplitScreen(tabId, splitScreenId)](./DMT_EditorControl.md)


</td><td>


</td><td>

将文档移动到指定分屏


</td></tr>
<tr><td>

[openDocument(documentUuid, splitScreenId)](./DMT_EditorControl.md)


</td><td>


</td><td>

打开文档


</td></tr>
<tr><td>

[openLibraryDocument(libraryUuid, libraryType, uuid, splitScreenId)](./DMT_EditorControl.md)


</td><td>


</td><td>

**_(BETA)_** 打开库符号、封装文档


</td></tr>
<tr><td>

[removeIndicatorMarkers(tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

**_(BETA)_** 移除指示标记


</td></tr>
<tr><td>

[tileAllDocumentToSplitScreen()](./DMT_EditorControl.md)


</td><td>


</td><td>

平铺所有文档


</td></tr>
<tr><td>

[zoomTo(x, y, scaleRatio, tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

**_(BETA)_** 缩放到坐标


</td></tr>
<tr><td>

[zoomToAllPrimitives(tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

**_(BETA)_** 缩放到所有图元（适应全部）


</td></tr>
<tr><td>

[zoomToRegion(left, right, top, bottom, tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

**_(BETA)_** 缩放到区域


</td></tr>
<tr><td>

[zoomToSelectedPrimitives(tabId)](./DMT_EditorControl.md)


</td><td>


</td><td>

**_(BETA)_** 缩放到已选中图元（适应选中）


</td></tr>
</tbody></table>

---

## 方法详情

### activatedocument

# DMT\_EditorControl.activateDocument() method

激活文档

## Signature

```typescript
activateDocument(tabId: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

tabId


</td><td>

string


</td><td>

标签页 ID


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

切换到指定文档的标签页，并将输入焦点置于其中

### activatesplitscreen

# DMT\_EditorControl.activateSplitScreen() method

激活分屏

## Signature

```typescript
activateSplitScreen(splitScreenId: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

splitScreenId


</td><td>

string


</td><td>

分屏 ID


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

使输入焦点

### closedocument

# DMT\_EditorControl.closeDocument() method

关闭文档

## Signature

```typescript
closeDocument(tabId: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

tabId


</td><td>

string


</td><td>

标签页 ID，此处支持 [IDMT\_SchematicPageItem.uuid](../interfaces/IDMT_SchematicPageItem.md)<!-- -->、[IDMT\_PcbItem.uuid](../interfaces/IDMT_PcbItem.md)<!-- -->、[IDMT\_PanelItem.uuid](../interfaces/IDMT_PanelItem.md) 作为输入


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

如若文档尚未保存，执行此操作将会直接丢失所有未保存的数据，请在修改操作完成后首先执行 [SCH\_Document.save()](./SCH_Document.md)<!-- -->、[PCB\_Document.save()](./PCB_Document.md)<!-- -->、[PNL\_Document.save()](./PNL_Document.md) 保存数据

### createsplitscreen

# DMT\_EditorControl.createSplitScreen() method

创建分屏

## Signature

```typescript
createSplitScreen(splitScreenType: EDMT_EditorSplitScreenDirection, tabId: string): Promise<{
        sourceSplitScreenId: string;
        newSplitScreenId: string;
    } | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

splitScreenType


</td><td>

[EDMT\_EditorSplitScreenDirection](../enums/EDMT_EditorSplitScreenDirection.md)


</td><td>

分屏类型，`horizontal` 水平、`vertical` 垂直


</td></tr>
<tr><td>

tabId


</td><td>

string


</td><td>

标签页 ID，该标签页将会被移入新的分屏中


</td></tr>
</tbody></table>



## Returns

Promise&lt;{ sourceSplitScreenId: string; newSplitScreenId: string; } \| undefined&gt;

分屏 ID，`sourceSplitScreenId` 代表源分屏，`newSplitScreenId` 代表新分屏

## Remarks

请确认 [tabId](./DMT_EditorControl.md) 对应的分屏存在两个以上的标签页，否则分屏将不会执行，并返回 `undefined`

### generateindicatormarkers

# DMT\_EditorControl.generateIndicatorMarkers() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

生成指示标记

## Signature

```typescript
generateIndicatorMarkers(markers: Array<IDMT_IndicatorMarkerShape>, color?: {
        r: number;
        g: number;
        b: number;
        alpha: number;
    }, lineWidth?: number, zoom?: boolean, tabId?: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

markers


</td><td>

Array&lt;[IDMT\_IndicatorMarkerShape](../interfaces/IDMT_IndicatorMarkerShape.md)<!-- -->&gt;


</td><td>

指示标记外形对象数组


</td></tr>
<tr><td>

color


</td><td>

\{ r: number; g: number; b: number; alpha: number; \}


</td><td>

_(Optional)_ 指示标记颜色


</td></tr>
<tr><td>

lineWidth


</td><td>

number


</td><td>

_(Optional)_ 线宽


</td></tr>
<tr><td>

zoom


</td><td>

boolean


</td><td>

_(Optional)_ 是否定位并缩放


</td></tr>
<tr><td>

tabId


</td><td>

string


</td><td>

_(Optional)_ 标签页 ID，如若未传入，则为最后输入焦点的画布


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

指示标记生成是否成功，`false` 表示画布不支持该操作或 `tabId` 不存在

## Remarks

指示标记外形数据中，原理图、符号画布坐标单位跨度为 0.01inch，PCB、封装画布坐标单位跨度为 mil

### getcurrentrenderedareaimage

# DMT\_EditorControl.getCurrentRenderedAreaImage() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取画布渲染区域图像

## Signature

```typescript
getCurrentRenderedAreaImage(tabId?: string): Promise<Blob | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

tabId


</td><td>

string


</td><td>

_(Optional)_ 标签页 ID，如若未传入，则获取最后输入焦点的画布


</td></tr>
</tbody></table>



## Returns

Promise&lt;Blob \| undefined&gt;

- 画布渲染区域的 Blob 格式图像数据

### getsplitscreenidbytabid

# DMT\_EditorControl.getSplitScreenIdByTabId() method

使用标签页 ID 获取分屏 ID

## Signature

```typescript
getSplitScreenIdByTabId(tabId: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

tabId


</td><td>

string


</td><td>

标签页 ID


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

分屏 ID

### getsplitscreentree

# DMT\_EditorControl.getSplitScreenTree() method

获取编辑器分屏属性树

## Signature

```typescript
getSplitScreenTree(): Promise<IDMT_EditorSplitScreenItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_EditorSplitScreenItem](../interfaces/IDMT_EditorSplitScreenItem.md) \| undefined&gt;

编辑器分屏属性树，如若为 `undefined`<!-- -->，则数据获取失败

### gettabsbysplitscreenid

# DMT\_EditorControl.getTabsBySplitScreenId() method

获取指定分屏 ID 下的所有标签页

## Signature

```typescript
getTabsBySplitScreenId(splitScreenId: string): Promise<Array<IDMT_EditorTabItem>>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

splitScreenId


</td><td>

string


</td><td>

分屏 ID


</td></tr>
</tbody></table>



## Returns

Promise&lt;Array&lt;[IDMT\_EditorTabItem](../interfaces/IDMT_EditorTabItem.md)<!-- -->&gt;&gt;

标签页列表

## Remarks

如果指定分屏下不存在直接标签页（即它属下还存在 [children](../interfaces/IDMT_EditorSplitScreenItem.md)<!-- -->），则返回空数组

### mergealldocumentfromsplitscreen

# DMT\_EditorControl.mergeAllDocumentFromSplitScreen() method

合并所有分屏

## Signature

```typescript
mergeAllDocumentFromSplitScreen(): Promise<boolean>;
```


## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

仅当存在子分屏时可用，将会取消所有子分屏，并将所有文档标签页合并到初始分屏内

### movedocumenttosplitscreen

# DMT\_EditorControl.moveDocumentToSplitScreen() method

将文档移动到指定分屏

## Signature

```typescript
moveDocumentToSplitScreen(tabId: string, splitScreenId: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

tabId


</td><td>

string


</td><td>

标签页 ID


</td></tr>
<tr><td>

splitScreenId


</td><td>

string


</td><td>

[分屏 ID](../interfaces/IDMT_EditorSplitScreenItem.md)


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

移动文档后，编辑器分屏属性树可能会出现变化

### opendocument

# DMT\_EditorControl.openDocument() method

打开文档

## Signature

```typescript
openDocument(documentUuid: string, splitScreenId?: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

documentUuid


</td><td>

string


</td><td>

文档 UUID，此处支持 [IDMT\_SchematicItem.uuid](../interfaces/IDMT_SchematicItem.md)<!-- -->、[IDMT\_SchematicPageItem.uuid](../interfaces/IDMT_SchematicPageItem.md)<!-- -->、[IDMT\_PcbItem.uuid](../interfaces/IDMT_PcbItem.md)<!-- -->、[IDMT\_PanelItem.uuid](../interfaces/IDMT_PanelItem.md) 作为输入


</td></tr>
<tr><td>

splitScreenId


</td><td>

string


</td><td>

_(Optional)_ 分屏 ID，即 [DMT\_EditorControl.getSplitScreenTree()](./DMT_EditorControl.md) 方法获取到的 [IDMT\_EditorSplitScreenItem.id](../interfaces/IDMT_EditorSplitScreenItem.md)


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

标签页 ID，如若为 `undefined`<!-- -->，则打开文档失败

### openlibrarydocument

# DMT\_EditorControl.openLibraryDocument() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

打开库符号、封装文档

## Signature

```typescript
openLibraryDocument(libraryUuid: string, libraryType: ELIB_LibraryType.SYMBOL | ELIB_LibraryType.FOOTPRINT, uuid: string, splitScreenId?: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

libraryUuid


</td><td>

string


</td><td>

库 UUID，可以使用 [LIB\_LibrariesList](./LIB_LibrariesList.md) 内的接口获取


</td></tr>
<tr><td>

libraryType


</td><td>

[ELIB\_LibraryType.SYMBOL](../enums/ELIB_LibraryType.md) \| [ELIB\_LibraryType.FOOTPRINT](../enums/ELIB_LibraryType.md)


</td><td>

库类型，支持符号和封装


</td></tr>
<tr><td>

uuid


</td><td>

string


</td><td>

符号、封装 UUID


</td></tr>
<tr><td>

splitScreenId


</td><td>

string


</td><td>

_(Optional)_ 分屏 ID，即 [DMT\_EditorControl.getSplitScreenTree()](./DMT_EditorControl.md) 方法获取到的 [IDMT\_EditorSplitScreenItem.id](../interfaces/IDMT_EditorSplitScreenItem.md)


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

标签页 ID，如若为 `undefined`<!-- -->，则打开文档失败

### removeindicatormarkers

# DMT\_EditorControl.removeIndicatorMarkers() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

移除指示标记

## Signature

```typescript
removeIndicatorMarkers(tabId?: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

tabId


</td><td>

string


</td><td>

_(Optional)_ 标签页 ID，如若未传入，则为最后输入焦点的画布


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

指示标记移除是否成功，`false` 表示画布不支持该操作或 `tabId` 不存在

## Remarks

本接口会移除所有已生成的指示标记

### tilealldocumenttosplitscreen

# DMT\_EditorControl.tileAllDocumentToSplitScreen() method

平铺所有文档

## Signature

```typescript
tileAllDocumentToSplitScreen(): Promise<boolean>;
```


## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

仅当不存在子分屏时可用，将会自动为所有已打开的文档标签页创建分屏

### zoomto

# DMT\_EditorControl.zoomTo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

缩放到坐标

## Signature

```typescript
zoomTo(x?: number, y?: number, scaleRatio?: number, tabId?: string): Promise<{
        left: number;
        right: number;
        top: number;
        bottom: number;
    } | false>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

x


</td><td>

number


</td><td>

_(Optional)_ 中心坐标 X，如若不传入则不改变当前 X 坐标


</td></tr>
<tr><td>

y


</td><td>

number


</td><td>

_(Optional)_ 中心坐标 Y，如若不传入则不改变当前 Y 坐标


</td></tr>
<tr><td>

scaleRatio


</td><td>

number


</td><td>

_(Optional)_ 缩放比，如若不传入则不改变当前缩放比，单位跨度为 `1/100`<!-- -->，如若传入 `200`<!-- -->，则表示缩放比为 `200%`


</td></tr>
<tr><td>

tabId


</td><td>

string


</td><td>

_(Optional)_ 标签页 ID，如若未传入，则为最后输入焦点的画布


</td></tr>
</tbody></table>



## Returns

Promise&lt;{ left: number; right: number; top: number; bottom: number; } \| false&gt;

缩放到的区域数据，`false` 表示画布不支持该缩放操作或 `tabId` 不存在

## Remarks

在原理图、符号画布坐标单位跨度为 0.01inch，在 PCB、封装画布坐标单位跨度为 mil

### zoomtoallprimitives

# DMT\_EditorControl.zoomToAllPrimitives() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

缩放到所有图元（适应全部）

## Signature

```typescript
zoomToAllPrimitives(tabId?: string): Promise<{
        left: number;
        right: number;
        top: number;
        bottom: number;
    } | false>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

tabId


</td><td>

string


</td><td>

_(Optional)_ 标签页 ID，如若未传入，则为最后输入焦点的画布


</td></tr>
</tbody></table>



## Returns

Promise&lt;{ left: number; right: number; top: number; bottom: number; } \| false&gt;

缩放到的区域数据，`false` 表示画布不支持该缩放操作或 `tabId` 不存在

## Remarks

在返回数据中，原理图、符号画布坐标单位跨度为 0.01inch，PCB、封装画布坐标单位跨度为 mil

### zoomtoregion

# DMT\_EditorControl.zoomToRegion() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

缩放到区域

## Signature

```typescript
zoomToRegion(left: number, right: number, top: number, bottom: number, tabId?: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

left


</td><td>

number


</td><td>

矩形框第一 X 坐标


</td></tr>
<tr><td>

right


</td><td>

number


</td><td>

矩形框第二 X 坐标


</td></tr>
<tr><td>

top


</td><td>

number


</td><td>

矩形框第一 Y 坐标


</td></tr>
<tr><td>

bottom


</td><td>

number


</td><td>

矩形框第二 Y 坐标


</td></tr>
<tr><td>

tabId


</td><td>

string


</td><td>

_(Optional)_ 标签页 ID，如若未传入，则为最后输入焦点的画布


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

在原理图、符号画布坐标单位跨度为 0.01inch，在 PCB、封装画布坐标单位跨度为 mil

### zoomtoselectedprimitives

# DMT\_EditorControl.zoomToSelectedPrimitives() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

缩放到已选中图元（适应选中）

## Signature

```typescript
zoomToSelectedPrimitives(tabId?: string): Promise<{
        left: number;
        right: number;
        top: number;
        bottom: number;
    } | false>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

tabId


</td><td>

string


</td><td>

_(Optional)_ 标签页 ID，如若未传入，则为最后输入焦点的画布


</td></tr>
</tbody></table>



## Returns

Promise&lt;{ left: number; right: number; top: number; bottom: number; } \| false&gt;

缩放到的区域数据，`false` 表示画布不支持该缩放操作或 `tabId` 不存在

## Remarks

在返回数据中，原理图、符号画布坐标单位跨度为 0.01inch，PCB、封装画布坐标单位跨度为 mil


path: references/classes/DMT_Folder.md
content: # DMT\_Folder class

文档树 / 文件夹类

## Signature

```typescript
declare class DMT_Folder 
```

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[createFolder(folderName, teamUuid, parentFolderUuid, description)](./DMT_Folder.md)


</td><td>


</td><td>

**_(BETA)_** 创建文件夹


</td></tr>
<tr><td>

[deleteFolder(teamUuid, folderUuid)](./DMT_Folder.md)


</td><td>


</td><td>

删除文件夹


</td></tr>
<tr><td>

[getAllFoldersUuid(teamUuid)](./DMT_Folder.md)


</td><td>


</td><td>

获取所有文件夹的 UUID


</td></tr>
<tr><td>

[getFolderInfo(teamUuid, folderUuid)](./DMT_Folder.md)


</td><td>


</td><td>

获取文件夹详细属性


</td></tr>
<tr><td>

[modifyFolderDescription(teamUuid, folderUuid, description)](./DMT_Folder.md)


</td><td>


</td><td>

**_(BETA)_** 修改文件夹描述


</td></tr>
<tr><td>

[modifyFolderName(teamUuid, folderUuid, folderName)](./DMT_Folder.md)


</td><td>


</td><td>

修改文件夹名称


</td></tr>
<tr><td>

[moveFolderToFolder(teamUuid, folderUuid, parentFolderUuid)](./DMT_Folder.md)


</td><td>


</td><td>

移动文件夹


</td></tr>
</tbody></table>

---

## 方法详情

### createfolder

# DMT\_Folder.createFolder() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

创建文件夹

## Signature

```typescript
createFolder(folderName: string, teamUuid: string, parentFolderUuid?: string, description?: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

folderName


</td><td>

string


</td><td>

文件夹名称


</td></tr>
<tr><td>

teamUuid


</td><td>

string


</td><td>

团队 UUID


</td></tr>
<tr><td>

parentFolderUuid


</td><td>

string


</td><td>

_(Optional)_ 父文件夹 UUID，如若不指定，则为根文件夹


</td></tr>
<tr><td>

description


</td><td>

string


</td><td>

_(Optional)_ 文件夹描述


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

文件夹 UUID，如若为 `undefined` 则创建失败

### deletefolder

# DMT\_Folder.deleteFolder() method

删除文件夹

## Signature

```typescript
deleteFolder(teamUuid: string, folderUuid: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

teamUuid


</td><td>

string


</td><td>

团队 UUID


</td></tr>
<tr><td>

folderUuid


</td><td>

string


</td><td>

文件夹 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

### getallfoldersuuid

# DMT\_Folder.getAllFoldersUuid() method

获取所有文件夹的 UUID

## Signature

```typescript
getAllFoldersUuid(teamUuid: string): Promise<Array<string>>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

teamUuid


</td><td>

string


</td><td>

团队 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;Array&lt;string&gt;&gt;

文件夹 UUID 数组

## Remarks

本接口忽略层级信息，将会返回所有层级的文件夹的 UUID 并放置于一维数组中

### getfolderinfo

# DMT\_Folder.getFolderInfo() method

获取文件夹详细属性

## Signature

```typescript
getFolderInfo(teamUuid: string, folderUuid: string): Promise<IDMT_FolderItem | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

teamUuid


</td><td>

string


</td><td>

团队 UUID


</td></tr>
<tr><td>

folderUuid


</td><td>

string


</td><td>

文件夹 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;[IDMT\_FolderItem](../interfaces/IDMT_FolderItem.md) \| undefined&gt;

文件夹属性，如若为 `undefined` 则获取失败

## Remarks

当 [parentFolderUuid](../interfaces/IDMT_FolderItem.md) 等于 [teamUuid](../interfaces/IDMT_FolderItem.md) 时，代表当前文件夹为指定团队下的一级文件夹

### modifyfolderdescription

# DMT\_Folder.modifyFolderDescription() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

修改文件夹描述

## Signature

```typescript
modifyFolderDescription(teamUuid: string, folderUuid: string, description?: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

teamUuid


</td><td>

string


</td><td>

团队 UUID


</td></tr>
<tr><td>

folderUuid


</td><td>

string


</td><td>

文件夹 UUID


</td></tr>
<tr><td>

description


</td><td>

string


</td><td>

_(Optional)_ 文件夹描述，如若为 `undefined` 则清空工程现有描述


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否修改成功

## Remarks

修改文件夹描述需要与工作区系统进行交互，修改操作存在延迟，需要短暂等待后才会呈现效果

### modifyfoldername

# DMT\_Folder.modifyFolderName() method

修改文件夹名称

## Signature

```typescript
modifyFolderName(teamUuid: string, folderUuid: string, folderName: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

teamUuid


</td><td>

string


</td><td>

团队 UUID


</td></tr>
<tr><td>

folderUuid


</td><td>

string


</td><td>

文件夹 UUID


</td></tr>
<tr><td>

folderName


</td><td>

string


</td><td>

文件夹名称


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否修改成功

### movefoldertofolder

# DMT\_Folder.moveFolderToFolder() method

移动文件夹

## Signature

```typescript
moveFolderToFolder(teamUuid: string, folderUuid: string, parentFolderUuid?: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

teamUuid


</td><td>

string


</td><td>

团队 UUID


</td></tr>
<tr><td>

folderUuid


</td><td>

string


</td><td>

文件夹 UUID


</td></tr>
<tr><td>

parentFolderUuid


</td><td>

string


</td><td>

_(Optional)_ 父文件夹 UUID，如若不指定，则默认为根文件夹


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否移动成功


path: references/classes/DMT_Panel.md
content: # DMT\_Panel class

文档树 / 面板管理类

## Signature

```typescript
declare class DMT_Panel 
```

## Remarks

在当前打开的工程内进行面板管理的相关操作

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[copyPanel(panelUuid)](./DMT_Panel.md)


</td><td>


</td><td>

复制面板


</td></tr>
<tr><td>

[createPanel()](./DMT_Panel.md)


</td><td>


</td><td>

**_(BETA)_** 创建面板


</td></tr>
<tr><td>

[deletePanel(panelUuid)](./DMT_Panel.md)


</td><td>


</td><td>

删除面板


</td></tr>
<tr><td>

[getAllPanelsInfo()](./DMT_Panel.md)


</td><td>


</td><td>

获取工程内所有面板的详细属性


</td></tr>
<tr><td>

[getCurrentPanelInfo()](./DMT_Panel.md)


</td><td>


</td><td>

获取当前面板的详细属性


</td></tr>
<tr><td>

[getPanelInfo(panelUuid)](./DMT_Panel.md)


</td><td>


</td><td>

获取面板的详细属性


</td></tr>
<tr><td>

[modifyPanelName(panelUuid, panelName)](./DMT_Panel.md)


</td><td>


</td><td>

修改面板名称


</td></tr>
</tbody></table>

---

## 方法详情

### copypanel

# DMT\_Panel.copyPanel() method

复制面板

## Signature

```typescript
copyPanel(panelUuid: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

panelUuid


</td><td>

string


</td><td>

源面板 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

新面板 UUID，如若为 `undefined` 则复制失败

### createpanel

# DMT\_Panel.createPanel() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

创建面板

## Signature

```typescript
createPanel(): Promise<string | undefined>;
```


## Returns

Promise&lt;string \| undefined&gt;

面板 UUID，如若为 `undefined` 则创建失败

### deletepanel

# DMT\_Panel.deletePanel() method

删除面板

## Signature

```typescript
deletePanel(panelUuid: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

panelUuid


</td><td>

string


</td><td>

面板 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

### getallpanelsinfo

# DMT\_Panel.getAllPanelsInfo() method

获取工程内所有面板的详细属性

## Signature

```typescript
getAllPanelsInfo(): Promise<Array<IDMT_PanelItem>>;
```


## Returns

Promise&lt;Array&lt;[IDMT\_PanelItem](../interfaces/IDMT_PanelItem.md)<!-- -->&gt;&gt;

所有面板的详细属性的数组

### getcurrentpanelinfo

# DMT\_Panel.getCurrentPanelInfo() method

获取当前面板的详细属性

## Signature

```typescript
getCurrentPanelInfo(): Promise<IDMT_PanelItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_PanelItem](../interfaces/IDMT_PanelItem.md) \| undefined&gt;

面板的详细属性，如若为 `undefined` 则获取失败

## Remarks

将会获取当前打开且拥有最后输入焦点的面板的详细属性

### getpanelinfo

# DMT\_Panel.getPanelInfo() method

获取面板的详细属性

## Signature

```typescript
getPanelInfo(panelUuid: string): Promise<IDMT_PanelItem | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

panelUuid


</td><td>

string


</td><td>

面板 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;[IDMT\_PanelItem](../interfaces/IDMT_PanelItem.md) \| undefined&gt;

面板的详细属性，如若为 `undefined` 则获取失败

### modifypanelname

# DMT\_Panel.modifyPanelName() method

修改面板名称

## Signature

```typescript
modifyPanelName(panelUuid: string, panelName: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

panelUuid


</td><td>

string


</td><td>

面板 UUID


</td></tr>
<tr><td>

panelName


</td><td>

string


</td><td>

面板名称


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否修改成功


path: references/classes/DMT_Pcb.md
content: # DMT\_Pcb class

文档树 / PCB 管理类

## Signature

```typescript
declare class DMT_Pcb 
```

## Remarks

在当前打开的工程内进行 PCB 管理的相关操作

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[copyPcb(pcbUuid, boardName)](./DMT_Pcb.md)


</td><td>


</td><td>

复制 PCB


</td></tr>
<tr><td>

[createPcb(boardName)](./DMT_Pcb.md)


</td><td>


</td><td>

创建 PCB


</td></tr>
<tr><td>

[deletePcb(pcbUuid)](./DMT_Pcb.md)


</td><td>


</td><td>

删除 PCB


</td></tr>
<tr><td>

[getAllPcbsInfo()](./DMT_Pcb.md)


</td><td>


</td><td>

获取工程内所有 PCB 的详细属性


</td></tr>
<tr><td>

[getCurrentPcbInfo()](./DMT_Pcb.md)


</td><td>


</td><td>

获取当前 PCB 的详细属性


</td></tr>
<tr><td>

[getPcbInfo(pcbUuid)](./DMT_Pcb.md)


</td><td>


</td><td>

获取 PCB 的详细属性


</td></tr>
<tr><td>

[modifyPcbName(pcbUuid, pcbName)](./DMT_Pcb.md)


</td><td>


</td><td>

修改 PCB 名称


</td></tr>
</tbody></table>

---

## 方法详情

### copypcb

# DMT\_Pcb.copyPcb() method

复制 PCB

## Signature

```typescript
copyPcb(pcbUuid: string, boardName?: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

pcbUuid


</td><td>

string


</td><td>

源 PCB UUID


</td></tr>
<tr><td>

boardName


</td><td>

string


</td><td>

_(Optional)_ 新 PCB 所属板子名称，如若不指定则为游离 PCB


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

新 PCB UUID，如若为 `undefined` 则复制失败

## Remarks

即使此处 PCB 已关联复用模块（在工程库内存在同名的复用模块符号），也不新建复用模块符号，此操作逻辑与当前编辑器前端保持一致

### createpcb

# DMT\_Pcb.createPcb() method

创建 PCB

## Signature

```typescript
createPcb(boardName?: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

boardName


</td><td>

string


</td><td>

_(Optional)_ 所属板子名称，如若不指定则为游离 PCB


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

PCB UUID，如若为 `undefined` 则创建失败

### deletepcb

# DMT\_Pcb.deletePcb() method

删除 PCB

## Signature

```typescript
deletePcb(pcbUuid: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

pcbUuid


</td><td>

string


</td><td>

PCB UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

如若 PCB 已关联复用模块（在工程库内存在同名的复用模块符号），则删除 PCB 时将同步删除关联的原理图和复用模块符号，复用模块符号不可删除则跳过

### getallpcbsinfo

# DMT\_Pcb.getAllPcbsInfo() method

获取工程内所有 PCB 的详细属性

## Signature

```typescript
getAllPcbsInfo(): Promise<Array<IDMT_PcbItem>>;
```


## Returns

Promise&lt;Array&lt;[IDMT\_PcbItem](../interfaces/IDMT_PcbItem.md)<!-- -->&gt;&gt;

所有 PCB 的详细属性的数组

### getcurrentpcbinfo

# DMT\_Pcb.getCurrentPcbInfo() method

获取当前 PCB 的详细属性

## Signature

```typescript
getCurrentPcbInfo(): Promise<IDMT_PcbItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_PcbItem](../interfaces/IDMT_PcbItem.md) \| undefined&gt;

PCB 的详细属性，如若为 `undefined` 则获取失败

## Remarks

将会获取当前打开且拥有最后输入焦点的 PCB 的详细属性

### getpcbinfo

# DMT\_Pcb.getPcbInfo() method

获取 PCB 的详细属性

## Signature

```typescript
getPcbInfo(pcbUuid: string): Promise<IDMT_PcbItem | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

pcbUuid


</td><td>

string


</td><td>

PCB UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;[IDMT\_PcbItem](../interfaces/IDMT_PcbItem.md) \| undefined&gt;

PCB 的详细属性，如若为 `undefined` 则获取失败

### modifypcbname

# DMT\_Pcb.modifyPcbName() method

修改 PCB 名称

## Signature

```typescript
modifyPcbName(pcbUuid: string, pcbName: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

pcbUuid


</td><td>

string


</td><td>

PCB UUID


</td></tr>
<tr><td>

pcbName


</td><td>

string


</td><td>

PCB 名称


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否修改成功

## Remarks

如若 PCB 已关联复用模块（在工程库内存在同名的复用模块符号），则修改名称时将同步修改复用模块符号名称与关联原理图名称


path: references/classes/DMT_Project.md
content: # DMT\_Project class

文档树 / 工程管理类

## Signature

```typescript
declare class DMT_Project 
```

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[createProject(projectFriendlyName, projectName, teamUuid, folderUuid, description, collaborationMode)](./DMT_Project.md)


</td><td>


</td><td>

**_(BETA)_** 创建工程


</td></tr>
<tr><td>

[getAllProjectsUuid(teamUuid, folderUuid, workspaceUuid)](./DMT_Project.md)


</td><td>


</td><td>

获取所有工程的 UUID


</td></tr>
<tr><td>

[getCurrentProjectInfo()](./DMT_Project.md)


</td><td>


</td><td>

获取当前工程的详细属性


</td></tr>
<tr><td>

[getProjectInfo(projectUuid)](./DMT_Project.md)


</td><td>


</td><td>

获取工程属性


</td></tr>
<tr><td>

[moveProjectToFolder(projectUuid, folderUuid)](./DMT_Project.md)


</td><td>


</td><td>

移动工程到文件夹


</td></tr>
<tr><td>

[openProject(projectUuid)](./DMT_Project.md)


</td><td>


</td><td>

打开工程


</td></tr>
</tbody></table>

---

## 方法详情

### createproject

# DMT\_Project.createProject() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

创建工程

## Signature

```typescript
createProject(projectFriendlyName: string, projectName?: string, teamUuid?: string, folderUuid?: string, description?: string, collaborationMode?: EDMT_ProjectCollaborationMode): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

projectFriendlyName


</td><td>

string


</td><td>

工程友好名称


</td></tr>
<tr><td>

projectName


</td><td>

string


</td><td>

_(Optional)_ 工程名称，不可重复，仅支持字母 `a-zA-Z`<!-- -->、数字 `0-9`<!-- -->、中划线 `-`<!-- -->，如若不指定，则根据工程友好名称自动生成


</td></tr>
<tr><td>

teamUuid


</td><td>

string


</td><td>

_(Optional)_ 团队 UUID，如若不指定，则默认为个人；在不存在个人工程的环境下必须指定团队 UUID


</td></tr>
<tr><td>

folderUuid


</td><td>

string


</td><td>

_(Optional)_ 文件夹 UUID，如若不指定，则为根文件夹


</td></tr>
<tr><td>

description


</td><td>

string


</td><td>

_(Optional)_ 工程描述


</td></tr>
<tr><td>

collaborationMode


</td><td>

[EDMT\_ProjectCollaborationMode](../enums/EDMT_ProjectCollaborationMode.md)


</td><td>

_(Optional)_ 工程协作模式，如若团队权限无需工程设置协作模式，则该参数将被忽略


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

工程 UUID，如若为 `undefined` 则创建失败

### getallprojectsuuid

# DMT\_Project.getAllProjectsUuid() method

获取所有工程的 UUID

## Signature

```typescript
getAllProjectsUuid(teamUuid?: string, folderUuid?: string, workspaceUuid?: string): Promise<Array<string>>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

teamUuid


</td><td>

string


</td><td>

_(Optional)_ 团队 UUID


</td></tr>
<tr><td>

folderUuid


</td><td>

string


</td><td>

_(Optional)_ 文件夹 UUID，如若不指定，则默认为团队的根文件夹


</td></tr>
<tr><td>

workspaceUuid


</td><td>

string


</td><td>

_(Optional)_ 工作区 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;Array&lt;string&gt;&gt;

工程 UUID 数组

## Remarks

如若指定 `teamUuid`<!-- -->，则获取指定团队下的所有工程；

如若指定 `folderUuid`<!-- -->，则获取指定文件夹下的所有工程；

`teamUuid`<!-- -->、`folderUuid` 需要且仅允许指定其一，如若都指定则只取 `folderUuid`<!-- -->；

如若指定 `workspaceUuid`<!-- -->，则在指定 Workspace 下获取指定团队/文件夹下的所有工程

### getcurrentprojectinfo

# DMT\_Project.getCurrentProjectInfo() method

获取当前工程的详细属性

## Signature

```typescript
getCurrentProjectInfo(): Promise<IDMT_ProjectItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_ProjectItem](../interfaces/IDMT_ProjectItem.md) \| undefined&gt;

工程属性，如若为 `undefined` 则获取失败

## Remarks

将会获取当前打开且拥有最后输入焦点的原理图、PCB、面板所关联的工程的详细属性

### getprojectinfo

# DMT\_Project.getProjectInfo() method

获取工程属性

## Signature

```typescript
getProjectInfo(projectUuid: string): Promise<IDMT_BriefProjectItem | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

projectUuid


</td><td>

string


</td><td>

工程 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;[IDMT\_BriefProjectItem](../interfaces/IDMT_BriefProjectItem.md) \| undefined&gt;

简略的工程属性，如若为 `undefined` 则获取失败

## Remarks

本接口只能读取简略的工程属性，如需详细的工程树，请使用 [getCurrentProjectInfo](./DMT_Project.md) 接口

### moveprojecttofolder

# DMT\_Project.moveProjectToFolder() method

移动工程到文件夹

## Signature

```typescript
moveProjectToFolder(projectUuid: string, folderUuid?: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

projectUuid


</td><td>

string


</td><td>

工程 UUID


</td></tr>
<tr><td>

folderUuid


</td><td>

string


</td><td>

_(Optional)_ 文件夹 UUID，只能为当前工程所在团队或个人下的文件夹，如若为 `undefined` 则移动到当前团队的根文件夹


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否移动成功

### openproject

# DMT\_Project.openProject() method

打开工程

## Signature

```typescript
openProject(projectUuid: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

projectUuid


</td><td>

string


</td><td>

工程 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否成功打开工程

## Remarks

本操作将会在 EDA 前端打开指定工程，如若原先已打开其它工程且有未保存的变更，执行本操作将直接丢失所有未保存的数据


path: references/classes/DMT_Schematic.md
content: # DMT\_Schematic class

文档树 / 原理图管理类

## Signature

```typescript
declare class DMT_Schematic 
```

## Remarks

在当前打开的工程内进行原理图管理的相关操作

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[copySchematic(schematicUuid, boardName)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 复制原理图


</td></tr>
<tr><td>

[copySchematicPage(schematicPageUuid, schematicUuid)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 复制原理图图页


</td></tr>
<tr><td>

[createSchematic(boardName)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 创建原理图


</td></tr>
<tr><td>

[createSchematicPage(schematicUuid)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 创建原理图图页


</td></tr>
<tr><td>

[deleteSchematic(schematicUuid)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 删除原理图


</td></tr>
<tr><td>

[deleteSchematicPage(schematicPageUuid)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 删除原理图图页


</td></tr>
<tr><td>

[getAllSchematicPagesInfo()](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 获取工程内所有原理图图页的详细属性


</td></tr>
<tr><td>

[getAllSchematicsInfo()](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 获取工程内所有原理图的详细属性


</td></tr>
<tr><td>

[getCurrentSchematicAllSchematicPagesInfo()](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 获取当前原理图内所有原理图图页的详细属性


</td></tr>
<tr><td>

[getCurrentSchematicInfo()](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 获取当前原理图的详细属性


</td></tr>
<tr><td>

[getCurrentSchematicPageInfo()](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 获取当前原理图图页的详细属性


</td></tr>
<tr><td>

[getSchematicInfo(schematicUuid)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 获取原理图的详细属性


</td></tr>
<tr><td>

[getSchematicPageInfo(schematicPageUuid)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 获取原理图图页的详细属性


</td></tr>
<tr><td>

[modifySchematicName(schematicUuid, schematicName)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 修改原理图名称


</td></tr>
<tr><td>

[modifySchematicPageName(schematicPageUuid, schematicPageName)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 修改原理图图页名称


</td></tr>
<tr><td>

[modifySchematicPageTitleBlock(showTitleBlock, titleBlockData)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 修改原理图图页明细表


</td></tr>
<tr><td>

[reorderSchematicPages(schematicUuid, schematicPageItemsArray)](./DMT_Schematic.md)


</td><td>


</td><td>

**_(BETA)_** 重新排序原理图图页


</td></tr>
</tbody></table>

---

## 方法详情

### copyschematic

# DMT\_Schematic.copySchematic() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

复制原理图

## Signature

```typescript
copySchematic(schematicUuid: string, boardName?: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicUuid


</td><td>

string


</td><td>

源原理图 UUID


</td></tr>
<tr><td>

boardName


</td><td>

string


</td><td>

_(Optional)_ 新原理图所属板子名称，如若不指定则为游离原理图


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

新原理图 UUID，如若为 `undefined` 则复制失败

## Remarks

如若原理图已关联复用模块（在工程库内存在同名的复用模块符号），则复制原理图时将同步新建复用模块符号

### copyschematicpage

# DMT\_Schematic.copySchematicPage() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

复制原理图图页

## Signature

```typescript
copySchematicPage(schematicPageUuid: string, schematicUuid?: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicPageUuid


</td><td>

string


</td><td>

源原理图图页 UUID


</td></tr>
<tr><td>

schematicUuid


</td><td>

string


</td><td>

_(Optional)_ 目标原理图 UUID，如若不指定则为当前原理图


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

新原理图图页 UUID，如若为 `undefined` 则复制失败

### createschematic

# DMT\_Schematic.createSchematic() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

创建原理图

## Signature

```typescript
createSchematic(boardName?: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

boardName


</td><td>

string


</td><td>

_(Optional)_ 所属板子名称，如若不指定则为游离原理图


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

原理图 UUID，如若为 `undefined` 则创建失败

### createschematicpage

# DMT\_Schematic.createSchematicPage() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

创建原理图图页

## Signature

```typescript
createSchematicPage(schematicUuid: string): Promise<string | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicUuid


</td><td>

string


</td><td>

所属原理图 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;string \| undefined&gt;

原理图图页 UUID，如若为 `undefined` 则创建失败

### deleteschematic

# DMT\_Schematic.deleteSchematic() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

删除原理图

## Signature

```typescript
deleteSchematic(schematicUuid: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicUuid


</td><td>

string


</td><td>

原理图 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

## Remarks

如若原理图已关联复用模块（在工程库内存在同名的复用模块符号），则删除原理图时将同步删除关联的 PCB 和复用模块符号，复用模块符号不可删除则跳过

### deleteschematicpage

# DMT\_Schematic.deleteSchematicPage() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

删除原理图图页

## Signature

```typescript
deleteSchematicPage(schematicPageUuid: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicPageUuid


</td><td>

string


</td><td>

原理图图页 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

操作是否成功

### getallschematicpagesinfo

# DMT\_Schematic.getAllSchematicPagesInfo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取工程内所有原理图图页的详细属性

## Signature

```typescript
getAllSchematicPagesInfo(): Promise<Array<IDMT_SchematicPageItem>>;
```


## Returns

Promise&lt;Array&lt;[IDMT\_SchematicPageItem](../interfaces/IDMT_SchematicPageItem.md)<!-- -->&gt;&gt;

所有原理图图页的详细属性的数组

### getallschematicsinfo

# DMT\_Schematic.getAllSchematicsInfo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取工程内所有原理图的详细属性

## Signature

```typescript
getAllSchematicsInfo(): Promise<Array<IDMT_SchematicItem>>;
```


## Returns

Promise&lt;Array&lt;[IDMT\_SchematicItem](../interfaces/IDMT_SchematicItem.md)<!-- -->&gt;&gt;

所有原理图的详细属性的数组

### getcurrentschematicallschematicpagesinfo

# DMT\_Schematic.getCurrentSchematicAllSchematicPagesInfo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取当前原理图内所有原理图图页的详细属性

## Signature

```typescript
getCurrentSchematicAllSchematicPagesInfo(): Promise<Array<IDMT_SchematicPageItem>>;
```


## Returns

Promise&lt;Array&lt;[IDMT\_SchematicPageItem](../interfaces/IDMT_SchematicPageItem.md)<!-- -->&gt;&gt;

所有原理图图页的详细属性的数组

### getcurrentschematicinfo

# DMT\_Schematic.getCurrentSchematicInfo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取当前原理图的详细属性

## Signature

```typescript
getCurrentSchematicInfo(): Promise<IDMT_SchematicItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_SchematicItem](../interfaces/IDMT_SchematicItem.md) \| undefined&gt;

原理图的详细属性，如若为 `undefined` 则获取失败

## Remarks

将会获取当前打开且拥有最后输入焦点的原理图图页所关联的原理图的详细属性

### getcurrentschematicpageinfo

# DMT\_Schematic.getCurrentSchematicPageInfo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取当前原理图图页的详细属性

## Signature

```typescript
getCurrentSchematicPageInfo(): Promise<IDMT_SchematicPageItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_SchematicPageItem](../interfaces/IDMT_SchematicPageItem.md) \| undefined&gt;

原理图图页的详细属性，如若为 `undefined` 则获取失败

## Remarks

将会获取当前打开且拥有最后输入焦点的原理图图页的详细属性

### getschematicinfo

# DMT\_Schematic.getSchematicInfo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取原理图的详细属性

## Signature

```typescript
getSchematicInfo(schematicUuid: string): Promise<IDMT_SchematicItem | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicUuid


</td><td>

string


</td><td>

原理图 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;[IDMT\_SchematicItem](../interfaces/IDMT_SchematicItem.md) \| undefined&gt;

原理图的详细属性，如若为 `undefined` 则获取失败

### getschematicpageinfo

# DMT\_Schematic.getSchematicPageInfo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取原理图图页的详细属性

## Signature

```typescript
getSchematicPageInfo(schematicPageUuid: string): Promise<IDMT_SchematicPageItem | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicPageUuid


</td><td>

string


</td><td>

原理图图页 UUID


</td></tr>
</tbody></table>



## Returns

Promise&lt;[IDMT\_SchematicPageItem](../interfaces/IDMT_SchematicPageItem.md) \| undefined&gt;

原理图图页的详细属性，如若为 `undefined` 则获取失败

### modifyschematicname

# DMT\_Schematic.modifySchematicName() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

修改原理图名称

## Signature

```typescript
modifySchematicName(schematicUuid: string, schematicName: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicUuid


</td><td>

string


</td><td>

原理图 UUID


</td></tr>
<tr><td>

schematicName


</td><td>

string


</td><td>

原理图名称


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否修改成功

## Remarks

如若原理图已关联复用模块（在工程库内存在同名的复用模块符号），则修改名称时将同步修改复用模块符号名称与关联 PCB 名称

### modifyschematicpagename

# DMT\_Schematic.modifySchematicPageName() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

修改原理图图页名称

## Signature

```typescript
modifySchematicPageName(schematicPageUuid: string, schematicPageName: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicPageUuid


</td><td>

string


</td><td>

原理图图页 UUID


</td></tr>
<tr><td>

schematicPageName


</td><td>

string


</td><td>

原理图图页名称


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

是否修改成功

### modifyschematicpagetitleblock

# DMT\_Schematic.modifySchematicPageTitleBlock() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

修改原理图图页明细表

## Signature

```typescript
modifySchematicPageTitleBlock(showTitleBlock?: boolean, titleBlockData?: {
        [key: string]: {
            showTitle?: boolean;
            showValue?: boolean;
            value?: any;
        };
    }): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

showTitleBlock


</td><td>

boolean


</td><td>

_(Optional)_ 是否显示明细表，不定义将保持当前状态


</td></tr>
<tr><td>

titleBlockData


</td><td>

\{ \[key: string\]: \{ showTitle?: boolean; showValue?: boolean; value?: any; \}; \}


</td><td>

_(Optional)_ 需要修改的明细项及其修改的值


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

修改操作是否成功，如若未传入 `showTitleBlock` 和 `titleBlockData` 将返回 `false`<!-- -->；请注意，如若存在无法识别的明细项但程序并未出错，将返回 `true` 的结果，因为无法识别的明细项被忽略

## Remarks

`titleBlockData` 仅需要传入任何需要修改的明细项作为 `key`<!-- -->，并传入其需要修改的值，任何无法识别的明细项将被忽略，任何未传入的项和值将保持默认状态

### reorderschematicpages

# DMT\_Schematic.reorderSchematicPages() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

重新排序原理图图页

## Signature

```typescript
reorderSchematicPages(schematicUuid: string, schematicPageItemsArray: Array<IDMT_SchematicPageItem>): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

schematicUuid


</td><td>

string


</td><td>

执行排序的图页所关联的原理图 UUID


</td></tr>
<tr><td>

schematicPageItemsArray


</td><td>

Array&lt;[IDMT\_SchematicPageItem](../interfaces/IDMT_SchematicPageItem.md)<!-- -->&gt;


</td><td>

所有原理图图页属性的数组


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

排序操作是否成功

## Remarks

此处源原理图图页属性的数组需要通过 [DMT\_Schematic.getAllSchematicPagesInfo()](./DMT_Schematic.md) 或其它上游方法取得，完成数组排序后传入


path: references/classes/DMT_SelectControl.md
content: # DMT\_SelectControl class

文档树 / 选择控制类

## Signature

```typescript
declare class DMT_SelectControl 
```

## Remarks

在文档树内进行选择焦点的查询、控制

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[getCurrentDocumentInfo()](./DMT_SelectControl.md)


</td><td>


</td><td>

**_(BETA)_** 获取当前文档的属性


</td></tr>
</tbody></table>

---

## 方法详情

### getcurrentdocumentinfo

# DMT\_SelectControl.getCurrentDocumentInfo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取当前文档的属性

## Signature

```typescript
getCurrentDocumentInfo(): Promise<IDMT_EditorDocumentItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_EditorDocumentItem](../interfaces/IDMT_EditorDocumentItem.md) \| undefined&gt;

文档类型、UUID、所属工程的 UUID、所属库的 UUID 组成的对象，如若为 `undefined` 则获取失败

## Remarks

将会获取当前打开且拥有最后输入焦点的文档的文档类型、UUID、所属工程的 UUID 或所属库的 UUID


path: references/classes/DMT_Team.md
content: # DMT\_Team class

文档树 / 团队类

## Signature

```typescript
declare class DMT_Team 
```

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[getAllInvolvedTeamInfo()](./DMT_Team.md)


</td><td>


</td><td>

获取所有参与的团队的详细属性


</td></tr>
<tr><td>

[getAllTeamsInfo()](./DMT_Team.md)


</td><td>


</td><td>

获取所有直接团队的详细属性


</td></tr>
<tr><td>

[getCurrentTeamInfo()](./DMT_Team.md)


</td><td>


</td><td>

获取当前团队的详细属性


</td></tr>
</tbody></table>

---

## 方法详情

### getallinvolvedteaminfo

# DMT\_Team.getAllInvolvedTeamInfo() method

获取所有参与的团队的详细属性

## Signature

```typescript
getAllInvolvedTeamInfo(): Promise<Array<IDMT_TeamItem>>;
```


## Returns

Promise&lt;Array&lt;[IDMT\_TeamItem](../interfaces/IDMT_TeamItem.md)<!-- -->&gt;&gt;

所有参与的团队的详细属性

### getallteamsinfo

# DMT\_Team.getAllTeamsInfo() method

获取所有直接团队的详细属性

## Signature

```typescript
getAllTeamsInfo(): Promise<Array<IDMT_TeamItem>>;
```


## Returns

Promise&lt;Array&lt;[IDMT\_TeamItem](../interfaces/IDMT_TeamItem.md)<!-- -->&gt;&gt;

所有团队的详细属性

## Remarks

个人本质上也是一个名为 \*\*个人\*\* 的团队

### getcurrentteaminfo

# DMT\_Team.getCurrentTeamInfo() method

获取当前团队的详细属性

## Signature

```typescript
getCurrentTeamInfo(): Promise<IDMT_TeamItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_TeamItem](../interfaces/IDMT_TeamItem.md) \| undefined&gt;

团队的详细属性，如若为 `undefined` 则获取失败

## Remarks

将会获取当前打开且拥有最后输入焦点的原理图、PCB、面板所关联的工程的所属团队的详细属性


path: references/classes/DMT_Workspace.md
content: # DMT\_Workspace class

文档树 / 工作区类

## Signature

```typescript
declare class DMT_Workspace 
```

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[getAllWorkspacesInfo()](./DMT_Workspace.md)


</td><td>


</td><td>

获取所有工作区的详细属性


</td></tr>
<tr><td>

[getCurrentWorkspaceInfo()](./DMT_Workspace.md)


</td><td>


</td><td>

获取当前工作区的详细属性


</td></tr>
<tr><td>

[toggleToWorkspace(workspaceUuid)](./DMT_Workspace.md)


</td><td>


</td><td>

切换到工作区


</td></tr>
</tbody></table>

---

## 方法详情

### getallworkspacesinfo

# DMT\_Workspace.getAllWorkspacesInfo() method

获取所有工作区的详细属性

## Signature

```typescript
getAllWorkspacesInfo(): Promise<Array<IDMT_WorkspaceItem>>;
```


## Returns

Promise&lt;Array&lt;[IDMT\_WorkspaceItem](../interfaces/IDMT_WorkspaceItem.md)<!-- -->&gt;&gt;

所有工作区的详细属性

### getcurrentworkspaceinfo

# DMT\_Workspace.getCurrentWorkspaceInfo() method

获取当前工作区的详细属性

## Signature

```typescript
getCurrentWorkspaceInfo(): Promise<IDMT_WorkspaceItem | undefined>;
```


## Returns

Promise&lt;[IDMT\_WorkspaceItem](../interfaces/IDMT_WorkspaceItem.md) \| undefined&gt;

工作区的详细属性，如若为 `undefined` 则获取失败

## Remarks

将会获取当前工作区的详细属性

### toggletoworkspace

# DMT\_Workspace.toggleToWorkspace() method

切换到工作区

## Signature

```typescript
toggleToWorkspace(workspaceUuid?: string): Promise<boolean>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

workspaceUuid


</td><td>

string


</td><td>

_(Optional)_ 工作区 UUID，如若不指定，则将切换到个人工作区


</td></tr>
</tbody></table>



## Returns

Promise&lt;boolean&gt;

切换操作是否成功


path: references/classes/EDA.md
content: # eda variable

扩展用户 API 接口

## Signature

```typescript
eda: EDA
```

---

## 属性详情

### dmt_board

# EDA.dmt\_Board property

## Signature

```typescript
dmt_Board: DMT_Board;
```

### dmt_editorcontrol

# EDA.dmt\_EditorControl property

## Signature

```typescript
dmt_EditorControl: DMT_EditorControl;
```

### dmt_folder

# EDA.dmt\_Folder property

## Signature

```typescript
dmt_Folder: DMT_Folder;
```

### dmt_panel

# EDA.dmt\_Panel property

## Signature

```typescript
dmt_Panel: DMT_Panel;
```

### dmt_pcb

# EDA.dmt\_Pcb property

## Signature

```typescript
dmt_Pcb: DMT_Pcb;
```

### dmt_project

# EDA.dmt\_Project property

## Signature

```typescript
dmt_Project: DMT_Project;
```

### dmt_schematic

# EDA.dmt\_Schematic property

## Signature

```typescript
dmt_Schematic: DMT_Schematic;
```

### dmt_selectcontrol

# EDA.dmt\_SelectControl property

## Signature

```typescript
dmt_SelectControl: DMT_SelectControl;
```

### dmt_team

# EDA.dmt\_Team property

## Signature

```typescript
dmt_Team: DMT_Team;
```

### dmt_workspace

# EDA.dmt\_Workspace property

## Signature

```typescript
dmt_Workspace: DMT_Workspace;
```

### lib_3dmodel

# EDA.lib\_3DModel property

## Signature

```typescript
lib_3DModel: LIB_3DModel;
```

### lib_cbb

# EDA.lib\_Cbb property

## Signature

```typescript
lib_Cbb: LIB_Cbb;
```

### lib_classification

# EDA.lib\_Classification property

## Signature

```typescript
lib_Classification: LIB_Classification;
```

### lib_device

# EDA.lib\_Device property

## Signature

```typescript
lib_Device: LIB_Device;
```

### lib_footprint

# EDA.lib\_Footprint property

## Signature

```typescript
lib_Footprint: LIB_Footprint;
```

### lib_librarieslist

# EDA.lib\_LibrariesList property

## Signature

```typescript
lib_LibrariesList: LIB_LibrariesList;
```

### lib_panellibrary

# EDA.lib\_PanelLibrary property

## Signature

```typescript
lib_PanelLibrary: LIB_PanelLibrary;
```

### lib_selectcontrol

# EDA.lib\_SelectControl property

## Signature

```typescript
lib_SelectControl: LIB_SelectControl;
```

### lib_symbol

# EDA.lib\_Symbol property

## Signature

```typescript
lib_Symbol: LIB_Symbol;
```

### pcb_document

# EDA.pcb\_Document property

## Signature

```typescript
pcb_Document: PCB_Document;
```

### pcb_drc

# EDA.pcb\_Drc property

## Signature

```typescript
pcb_Drc: PCB_Drc;
```

### pcb_event

# EDA.pcb\_Event property

## Signature

```typescript
pcb_Event: PCB_Event;
```

### pcb_layer

# EDA.pcb\_Layer property

## Signature

```typescript
pcb_Layer: PCB_Layer;
```

### pcb_manufacturedata

# EDA.pcb\_ManufactureData property

## Signature

```typescript
pcb_ManufactureData: PCB_ManufactureData;
```

### pcb_mathpolygon

# EDA.pcb\_MathPolygon property

## Signature

```typescript
pcb_MathPolygon: PCB_MathPolygon;
```

### pcb_net

# EDA.pcb\_Net property

## Signature

```typescript
pcb_Net: PCB_Net;
```

### pcb_primitive

# EDA.pcb\_Primitive property

## Signature

```typescript
pcb_Primitive: PCB_Primitive;
```

### pcb_primitivearc

# EDA.pcb\_PrimitiveArc property

## Signature

```typescript
pcb_PrimitiveArc: PCB_PrimitiveArc;
```

### pcb_primitiveattribute

# EDA.pcb\_PrimitiveAttribute property

## Signature

```typescript
pcb_PrimitiveAttribute: PCB_PrimitiveAttribute;
```

### pcb_primitivecomponent

# EDA.pcb\_PrimitiveComponent property

## Signature

```typescript
pcb_PrimitiveComponent: PCB_PrimitiveComponent;
```

### pcb_primitivedimension

# EDA.pcb\_PrimitiveDimension property

## Signature

```typescript
pcb_PrimitiveDimension: PCB_PrimitiveDimension;
```

### pcb_primitivefill

# EDA.pcb\_PrimitiveFill property

## Signature

```typescript
pcb_PrimitiveFill: PCB_PrimitiveFill;
```

### pcb_primitiveimage

# EDA.pcb\_PrimitiveImage property

## Signature

```typescript
pcb_PrimitiveImage: PCB_PrimitiveImage;
```

### pcb_primitiveline

# EDA.pcb\_PrimitiveLine property

## Signature

```typescript
pcb_PrimitiveLine: PCB_PrimitiveLine;
```

### pcb_primitiveobject

# EDA.pcb\_PrimitiveObject property

## Signature

```typescript
pcb_PrimitiveObject: PCB_PrimitiveObject;
```

### pcb_primitivepad

# EDA.pcb\_PrimitivePad property

## Signature

```typescript
pcb_PrimitivePad: PCB_PrimitivePad;
```

### pcb_primitivepolyline

# EDA.pcb\_PrimitivePolyline property

## Signature

```typescript
pcb_PrimitivePolyline: PCB_PrimitivePolyline;
```

### pcb_primitivepour

# EDA.pcb\_PrimitivePour property

## Signature

```typescript
pcb_PrimitivePour: PCB_PrimitivePour;
```

### pcb_primitivepoured

# EDA.pcb\_PrimitivePoured property

## Signature

```typescript
pcb_PrimitivePoured: PCB_PrimitivePoured;
```

### pcb_primitiveregion

# EDA.pcb\_PrimitiveRegion property

## Signature

```typescript
pcb_PrimitiveRegion: PCB_PrimitiveRegion;
```

### pcb_primitivestring

# EDA.pcb\_PrimitiveString property

## Signature

```typescript
pcb_PrimitiveString: PCB_PrimitiveString;
```

### pcb_primitivevia

# EDA.pcb\_PrimitiveVia property

## Signature

```typescript
pcb_PrimitiveVia: PCB_PrimitiveVia;
```

### pcb_raytracerengine

# EDA.pcb\_RayTracerEngine property

## Signature

```typescript
pcb_RayTracerEngine: PCB_RayTracerEngine;
```

### pcb_selectcontrol

# EDA.pcb\_SelectControl property

## Signature

```typescript
pcb_SelectControl: PCB_SelectControl;
```

### pnl_document

# EDA.pnl\_Document property

## Signature

```typescript
pnl_Document: PNL_Document;
```

### sch_document

# EDA.sch\_Document property

## Signature

```typescript
sch_Document: SCH_Document;
```

### sch_drc

# EDA.sch\_Drc property

## Signature

```typescript
sch_Drc: SCH_Drc;
```

### sch_event

# EDA.sch\_Event property

## Signature

```typescript
sch_Event: SCH_Event;
```

### sch_manufacturedata

# EDA.sch\_ManufactureData property

## Signature

```typescript
sch_ManufactureData: SCH_ManufactureData;
```

### sch_net

# EDA.sch\_Net property

## Signature

```typescript
sch_Net: SCH_Net;
```

### sch_netlist

# EDA.sch\_Netlist property

## Signature

```typescript
sch_Netlist: SCH_Netlist;
```

### sch_primitive

# EDA.sch\_Primitive property

## Signature

```typescript
sch_Primitive: SCH_Primitive;
```

### sch_primitivearc

# EDA.sch\_PrimitiveArc property

## Signature

```typescript
sch_PrimitiveArc: SCH_PrimitiveArc;
```

### sch_primitiveattribute

# EDA.sch\_PrimitiveAttribute property

## Signature

```typescript
sch_PrimitiveAttribute: SCH_PrimitiveAttribute;
```

### sch_primitivebus

# EDA.sch\_PrimitiveBus property

## Signature

```typescript
sch_PrimitiveBus: SCH_PrimitiveBus;
```

### sch_primitivecircle

# EDA.sch\_PrimitiveCircle property

## Signature

```typescript
sch_PrimitiveCircle: SCH_PrimitiveCircle;
```

### sch_primitivecomponent

# EDA.sch\_PrimitiveComponent property

## Signature

```typescript
sch_PrimitiveComponent: SCH_PrimitiveComponent | SCH_PrimitiveComponent3;
```

### sch_primitiveobject

# EDA.sch\_PrimitiveObject property

## Signature

```typescript
sch_PrimitiveObject: SCH_PrimitiveObject;
```

### sch_primitivepin

# EDA.sch\_PrimitivePin property

## Signature

```typescript
sch_PrimitivePin: SCH_PrimitivePin;
```

### sch_primitivepolygon

# EDA.sch\_PrimitivePolygon property

## Signature

```typescript
sch_PrimitivePolygon: SCH_PrimitivePolygon;
```

### sch_primitiverectangle

# EDA.sch\_PrimitiveRectangle property

## Signature

```typescript
sch_PrimitiveRectangle: SCH_PrimitiveRectangle;
```

### sch_primitivetext

# EDA.sch\_PrimitiveText property

## Signature

```typescript
sch_PrimitiveText: SCH_PrimitiveText;
```

### sch_primitivewire

# EDA.sch\_PrimitiveWire property

## Signature

```typescript
sch_PrimitiveWire: SCH_PrimitiveWire;
```

### sch_selectcontrol

# EDA.sch\_SelectControl property

## Signature

```typescript
sch_SelectControl: SCH_SelectControl;
```

### sch_simulationengine

# EDA.sch\_SimulationEngine property

## Signature

```typescript
sch_SimulationEngine: SCH_SimulationEngine;
```

### sch_utils

# EDA.sch\_Utils property

## Signature

```typescript
sch_Utils: SCH_Utils;
```

### sys_clienturl

# EDA.sys\_ClientUrl property

## Signature

```typescript
sys_ClientUrl: SYS_ClientUrl;
```

### sys_dialog

# EDA.sys\_Dialog property

## Signature

```typescript
sys_Dialog: SYS_Dialog;
```

### sys_environment

# EDA.sys\_Environment property

## Signature

```typescript
sys_Environment: SYS_Environment;
```

### sys_filemanager

# EDA.sys\_FileManager property

## Signature

```typescript
sys_FileManager: SYS_FileManager;
```

### sys_filesystem

# EDA.sys\_FileSystem property

## Signature

```typescript
sys_FileSystem: SYS_FileSystem;
```

### sys_fontmanager

# EDA.sys\_FontManager property

## Signature

```typescript
sys_FontManager: SYS_FontManager;
```

### sys_formatconversion

# EDA.sys\_FormatConversion property

## Signature

```typescript
sys_FormatConversion: SYS_FormatConversion;
```

### sys_headermenu

# EDA.sys\_HeaderMenu property

## Signature

```typescript
sys_HeaderMenu: SYS_HeaderMenu;
```

### sys_i18n

# EDA.sys\_I18n property

## Signature

```typescript
sys_I18n: SYS_I18n;
```

### sys_iframe

# EDA.sys\_IFrame property

## Signature

```typescript
sys_IFrame: SYS_IFrame;
```

### sys_loadingandprogressbar

# EDA.sys\_LoadingAndProgressBar property

## Signature

```typescript
sys_LoadingAndProgressBar: SYS_LoadingAndProgressBar;
```

### sys_log

# EDA.sys\_Log property

## Signature

```typescript
sys_Log: SYS_Log;
```

### sys_message

# EDA.sys\_Message property

## Signature

```typescript
sys_Message: SYS_Message;
```

### sys_messagebox

# EDA.sys\_MessageBox property

## Signature

```typescript
sys_MessageBox: SYS_MessageBox;
```

### sys_messagebus

# EDA.sys\_MessageBus property

## Signature

```typescript
sys_MessageBus: SYS_MessageBus;
```

### sys_panelcontrol

# EDA.sys\_PanelControl property

## Signature

```typescript
sys_PanelControl: SYS_PanelControl;
```

### sys_rightclickmenu

# EDA.sys\_RightClickMenu property

## Signature

```typescript
sys_RightClickMenu: SYS_RightClickMenu;
```

### sys_setting

# EDA.sys\_Setting property

## Signature

```typescript
sys_Setting: SYS_Setting;
```

### sys_shortcutkey

# EDA.sys\_ShortcutKey property

## Signature

```typescript
sys_ShortcutKey: SYS_ShortcutKey;
```

### sys_storage

# EDA.sys\_Storage property

## Signature

```typescript
sys_Storage: SYS_Storage;
```

### sys_timer

# EDA.sys\_Timer property

## Signature

```typescript
sys_Timer: SYS_Timer;
```

### sys_toastmessage

# EDA.sys\_ToastMessage property

## Signature

```typescript
sys_ToastMessage: SYS_ToastMessage;
```

### sys_tool

# EDA.sys\_Tool property

## Signature

```typescript
sys_Tool: SYS_Tool;
```

### sys_unit

# EDA.sys\_Unit property

## Signature

```typescript
sys_Unit: SYS_Unit;
```

### sys_websocket

# EDA.sys\_WebSocket property

## Signature

```typescript
sys_WebSocket: SYS_WebSocket;
```

### sys_window

# EDA.sys\_Window property

## Signature

```typescript
sys_Window: SYS_Window;
```


path: references/classes/IPCB_ComplexPolygon.md
content: # IPCB\_ComplexPolygon class

复杂多边形

## Signature

```typescript
declare class IPCB_ComplexPolygon 
```

## Remarks

复杂多边形可以包含多个单多边形，通过 [fill-rule](https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute/fill-rule) 将其组合，以实现多边形的布尔运算。 目前嘉立创 EDA 专业版固定使用 [nonzero](https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute/fill-rule#nonzero) 这个 fill-rule。


## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[addSource(complexPolygon)](./IPCB_ComplexPolygon.md)


</td><td>


</td><td>

添加多边形数据


</td></tr>
<tr><td>

[getSource()](./IPCB_ComplexPolygon.md)


</td><td>


</td><td>

获取多边形数据


</td></tr>
<tr><td>

[getSourceStrictComplex()](./IPCB_ComplexPolygon.md)


</td><td>


</td><td>

获取复杂多边形数据


</td></tr>
</tbody></table>

---

## 方法详情

### addsource

# IPCB\_ComplexPolygon.addSource() method

添加多边形数据

## Signature

```typescript
addSource(complexPolygon: TPCB_PolygonSourceArray | Array<TPCB_PolygonSourceArray> | IPCB_Polygon | Array<IPCB_Polygon>): IPCB_ComplexPolygon;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

complexPolygon


</td><td>

[TPCB\_PolygonSourceArray](../types/TPCB_PolygonSourceArray.md) \| Array&lt;[TPCB\_PolygonSourceArray](../types/TPCB_PolygonSourceArray.md)<!-- -->&gt; \| [IPCB\_Polygon](./IPCB_Polygon.md) \| Array&lt;[IPCB\_Polygon](./IPCB_Polygon.md)<!-- -->&gt;


</td><td>

复杂多边形数据


</td></tr>
</tbody></table>



## Returns

[IPCB\_ComplexPolygon](./IPCB_ComplexPolygon.md)

复杂多边形对象

### getsource

# IPCB\_ComplexPolygon.getSource() method

获取多边形数据

## Signature

```typescript
getSource(): TPCB_PolygonSourceArray | Array<TPCB_PolygonSourceArray>;
```


## Returns

[TPCB\_PolygonSourceArray](../types/TPCB_PolygonSourceArray.md) \| Array&lt;[TPCB\_PolygonSourceArray](../types/TPCB_PolygonSourceArray.md)<!-- -->&gt;

单多边形或复杂多边形数据

## Remarks

如遇仅包含单一的单多边形，将会化简最外层的数组

### getsourcestrictcomplex

# IPCB\_ComplexPolygon.getSourceStrictComplex() method

获取复杂多边形数据

## Signature

```typescript
getSourceStrictComplex(): Array<TPCB_PolygonSourceArray>;
```


## Returns

Array&lt;[TPCB\_PolygonSourceArray](../types/TPCB_PolygonSourceArray.md)<!-- -->&gt;

复杂多边形数据

## Remarks

强制返回复杂多边形格式数据，即使它仅包含单一的单多边形


path: references/classes/IPCB_Polygon.md
content: # IPCB\_Polygon class

单多边形

## Signature

```typescript
declare class IPCB_Polygon 
```

## Remarks


## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[getSource()](./IPCB_Polygon.md)


</td><td>


</td><td>

获取单多边形数据


</td></tr>
</tbody></table>

---

## 方法详情

### getsource

# IPCB\_Polygon.getSource() method

获取单多边形数据

## Signature

```typescript
getSource(): TPCB_PolygonSourceArray;
```


## Returns

[TPCB\_PolygonSourceArray](../types/TPCB_PolygonSourceArray.md)

单多边形数据


path: references/classes/IPCB_PrimitiveComponentPad.md
content: # IPCB\_PrimitiveComponentPad class

器件焊盘图元

## Signature

```typescript
declare class IPCB_PrimitiveComponentPad extends IPCB_PrimitivePad 
```
**Extends:** [IPCB\_PrimitivePad](./IPCB_PrimitivePad.md)

## Remarks

器件焊盘图元是一个特殊的图元，它指的是在 PCB 画布上关联到封装的焊盘

你只能通过 [器件类的 getAllPinsByPrimitiveId 方法](./PCB_PrimitiveComponent.md) 或 [器件图元的 getAllPads 方法](./IPCB_PrimitiveComponent.md) 获取到器件焊盘图元


## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[primitiveType](./IPCB_PrimitiveComponentPad.md)


</td><td>

`protected`

`readonly`


</td><td>

[EPCB\_PrimitiveType.COMPONENT\_PAD](../enums/EPCB_PrimitiveType.md)


</td><td>

图元类型


</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[done()](./IPCB_PrimitiveComponentPad.md)


</td><td>


</td><td>

**_(BETA)_** 将对图元的更改应用到画布


</td></tr>
<tr><td>

[getConnectedPrimitives(onlyCentreConnection)](./IPCB_PrimitiveComponentPad.md)


</td><td>


</td><td>

**_(BETA)_** 获取连接的图元


</td></tr>
<tr><td>

[getConnectedPrimitives(onlyCentreConnection)](./IPCB_PrimitiveComponentPad.md)


</td><td>


</td><td>


</td></tr>
<tr><td>

[getState\_ParentComponentPrimitiveId()](./IPCB_PrimitiveComponentPad.md)


</td><td>


</td><td>

获取属性状态：父器件图元 ID


</td></tr>
<tr><td>

[setState\_ParentComponentPrimitiveId()](./IPCB_PrimitiveComponentPad.md)


</td><td>


</td><td>

设置属性状态：父器件图元 ID


</td></tr>
</tbody></table>

---

## 属性详情

### primitivetype

# IPCB\_PrimitiveComponentPad.primitiveType property

图元类型

## Signature

```typescript
protected readonly primitiveType: EPCB_PrimitiveType.COMPONENT_PAD;
```


---

## 方法详情

### done

# IPCB\_PrimitiveComponentPad.done() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

将对图元的更改应用到画布

## Signature

```typescript
done(): Promise<IPCB_PrimitiveComponentPad>;
```


## Returns

Promise&lt;[IPCB\_PrimitiveComponentPad](./IPCB_PrimitiveComponentPad.md)<!-- -->&gt;

器件焊盘图元对象

### getconnectedprimitives

# IPCB\_PrimitiveComponentPad.getConnectedPrimitives() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取连接的图元

## Signature

```typescript
getConnectedPrimitives(onlyCentreConnection: true): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc | IPCB_PrimitiveVia>>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

onlyCentreConnection


</td><td>

true


</td><td>

是否仅中心连接，如若为 `true` 则仅获取中心连接的图元（直线、圆弧线、过孔），如若为 `false` 则获取所有接触的图元


</td></tr>
</tbody></table>



## Returns

Promise&lt;Array&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md)<!-- -->&gt;&gt;

## Remarks

本接口可以获取到与焊盘直接接触的图元

### getconnectedprimitives_1

# IPCB\_PrimitiveComponentPad.getConnectedPrimitives() method

## Signature

```typescript
getConnectedPrimitives(onlyCentreConnection: false): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc | IPCB_PrimitiveVia | IPCB_PrimitivePolyline | IPCB_PrimitiveFill>>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

onlyCentreConnection


</td><td>

false


</td><td>


</td></tr>
</tbody></table>



## Returns

Promise&lt;Array&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md) \| [IPCB\_PrimitivePolyline](./IPCB_PrimitivePolyline.md) \| [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)<!-- -->&gt;&gt;

### getstate_parentcomponentprimitiveid

# IPCB\_PrimitiveComponentPad.getState\_ParentComponentPrimitiveId() method

获取属性状态：父器件图元 ID

## Signature

```typescript
getState_ParentComponentPrimitiveId(): string;
```


## Returns

string

父器件图元 ID

### setstate_parentcomponentprimitiveid

# IPCB\_PrimitiveComponentPad.setState\_ParentComponentPrimitiveId() method

设置属性状态：父器件图元 ID

## Signature

```typescript
setState_ParentComponentPrimitiveId(): IPCB_PrimitiveComponentPad;
```


## Returns

[IPCB\_PrimitiveComponentPad](./IPCB_PrimitiveComponentPad.md)

器件焊盘图元对象

## Remarks

本器件焊盘图元属性不支持修改，本接口调用将不会有任何效果


path: references/classes/ISCH_PrimitiveCbbSymbolComponent.md
content: # ISCH\_PrimitiveCbbSymbolComponent class

复用模块符号图元

## Signature

```typescript
declare class ISCH_PrimitiveCbbSymbolComponent extends ISCH_PrimitiveComponent 
```
**Extends:** [ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md)

## Remarks


## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[getState\_Cbb()](./ISCH_PrimitiveCbbSymbolComponent.md)


</td><td>


</td><td>

获取属性状态：关联复用模块


</td></tr>
<tr><td>

[getState\_CbbSymbol()](./ISCH_PrimitiveCbbSymbolComponent.md)


</td><td>


</td><td>

获取属性状态：关联复用模块符号


</td></tr>
</tbody></table>

---

## 方法详情

### getstate_cbb

# ISCH\_PrimitiveCbbSymbolComponent.getState\_Cbb() method

获取属性状态：关联复用模块

## Signature

```typescript
getState_Cbb(): {
        libraryUuid: string;
        uuid: string;
    };
```


## Returns

\{ libraryUuid: string; uuid: string; \}

关联复用模块

### getstate_cbbsymbol

# ISCH\_PrimitiveCbbSymbolComponent.getState\_CbbSymbol() method

获取属性状态：关联复用模块符号

## Signature

```typescript
getState_CbbSymbol(): {
        libraryUuid: string;
        cbbUuid: string;
        uuid?: string;
        name?: string;
    };
```


## Returns

\{ libraryUuid: string; cbbUuid: string; uuid?: string; name?: string; \}

关联复用模块符号


path: references/classes/ISCH_PrimitiveComponentPin.md
content: # ISCH\_PrimitiveComponentPin class

器件引脚图元

## Signature

```typescript
declare class ISCH_PrimitiveComponentPin extends ISCH_PrimitivePin 
```
**Extends:** [ISCH\_PrimitivePin](./ISCH_PrimitivePin.md)

## Remarks

器件引脚图元是一个特殊的图元，它指的是在原理图画布上关联到符号的引脚

器件引脚图元仅可更改 `pinNumber`<!-- -->、`noConnected` 属性，其它所有属性均为只读， 并且你只能通过 [器件类的 getAllPinsByPrimitiveId 方法](./SCH_PrimitiveComponent.md) 或  获取到器件引脚图元


## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[primitiveType](./ISCH_PrimitiveComponentPin.md)


</td><td>

`protected`

`readonly`


</td><td>

[ESCH\_PrimitiveType.COMPONENT\_PIN](../enums/ESCH_PrimitiveType.md)


</td><td>

图元类型


</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[getState\_NoConnected()](./ISCH_PrimitiveComponentPin.md)


</td><td>


</td><td>

获取属性状态：是否存在非连接标识


</td></tr>
<tr><td>

[setState\_NoConnected(noConnected)](./ISCH_PrimitiveComponentPin.md)


</td><td>


</td><td>

设置属性状态：是否存在非连接标识


</td></tr>
</tbody></table>

---

## 属性详情

### primitivetype

# ISCH\_PrimitiveComponentPin.primitiveType property

图元类型

## Signature

```typescript
protected readonly primitiveType: ESCH_PrimitiveType.COMPONENT_PIN;
```


---

## 方法详情

### getstate_noconnected

# ISCH\_PrimitiveComponentPin.getState\_NoConnected() method

获取属性状态：是否存在非连接标识

## Signature

```typescript
getState_NoConnected(): boolean;
```


## Returns

boolean

是否存在非连接标识

### setstate_noconnected

# ISCH\_PrimitiveComponentPin.setState\_NoConnected() method

设置属性状态：是否存在非连接标识

## Signature

```typescript
setState_NoConnected(noConnected: boolean): ISCH_PrimitiveComponentPin;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

noConnected


</td><td>

boolean


</td><td>


</td></tr>
</tbody></table>



## Returns

[ISCH\_PrimitiveComponentPin](./ISCH_PrimitiveComponentPin.md)

器件引脚图元对象


path: references/classes/LIB_SelectControl.md
content: # LIB\_SelectControl class

综合库 / 选择控制类

## Signature

```typescript
declare class LIB_SelectControl 
```

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[getSelectedLibraryRowInfo()](./LIB_SelectControl.md)


</td><td>


</td><td>

**_(BETA)_** 获取当前底部库选中行的信息


</td></tr>
</tbody></table>

---

## 方法详情

### getselectedlibraryrowinfo

# LIB\_SelectControl.getSelectedLibraryRowInfo() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

获取当前底部库选中行的信息

## Signature

```typescript
getSelectedLibraryRowInfo(): Promise<ILIB_LibraryItem | undefined>;
```


## Returns

Promise&lt;[ILIB\_LibraryItem](../interfaces/ILIB_LibraryItem.md) \| undefined&gt;

库属性对象，如若为 `undefined` 则获取失败

## Remarks

将会获取当前底部库选中行的库类型、UUID、所属库 UUID


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)