DMT_Pcb.deletePcb() method
Delete PCB
Signature
typescript
function deletePcb(pcbUuid: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
pcbUuid | string | PCB UUID |
Returns
Promise<boolean>
Whether the operation is successful
Remarks
If the PCB is already associated with a reuse block (a reuse block symbol with the same name exists in the project library), deleting the PCB will also delete the associated schematic and reuse block symbol. If the reuse block symbol cannot be deleted, it will be skipped
Example
javascript
// 1. 创建专用测试 PCB(避免误删工程里的现有 PCB),等 1.5s 同步
const pcbUuid = await eda.dmt_Pcb.createPcb();
await new Promise(r => setTimeout(r, 1500));
// 2. 删除该 PCB
const deleted = await eda.dmt_Pcb.deletePcb(pcbUuid);
console.log('deleted:', deleted);
// 3. 回读确认已删除(返回 undefined 说明 PCB 已不存在)
const info = await eda.dmt_Pcb.getPcbInfo(pcbUuid);
console.log('info after delete:', info === undefined ? '已不存在' : info.name);1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11