Home > PCB_Document > importChanges
PCB_Document.importChanges() method
Import changes from the schematic
Signature
typescript
function importChanges(uuid?: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
uuid | string | (Optional) Schematic UUID. By default, the schematic associated with the same Board is used |
Returns
Promise<boolean>
Whether the import operation was successful. If the import fails or the free PCB has no schematic UUID passed in, false is returned
Example
javascript
// 1. 创建测试原理图和测试 PCB
const schUuid = await eda.dmt_Schematic.createSchematic();
await new Promise(r => setTimeout(r, 1500));
const pcbUuid = await eda.dmt_Pcb.createPcb();
await new Promise(r => setTimeout(r, 1500));
// 2. 创建板子把原理图与 PCB 关联起来(返回板子名称)
const boardName = await eda.dmt_Board.createBoard(schUuid, pcbUuid);
await new Promise(r => setTimeout(r, 1500));
console.log('boardName:', boardName);
// 3. 打开 PCB 并从关联原理图导入变更
await eda.dmt_EditorControl.openDocument(pcbUuid);
await new Promise(r => setTimeout(r, 1000));
const imported = await eda.pcb_Document.importChanges();
console.log('imported:', imported);
// 4. 清理:删板子、删 PCB、删原理图
await eda.dmt_Board.deleteBoard(boardName);
await new Promise(r => setTimeout(r, 1000));
await eda.dmt_Pcb.deletePcb(pcbUuid);
await eda.dmt_Schematic.deleteSchematic(schUuid);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22