DMT_Pcb.deletePcb() method
删除 PCB
签名
typescript
function deletePcb(pcbUuid: string): Promise<boolean>;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
pcbUuid | string | PCB UUID |
返回值
Promise<boolean>
操作是否成功
备注
如若 PCB 已关联复用模块(在工程库内存在同名的复用模块符号),则删除 PCB 时将同步删除关联的原理图和复用模块符号,复用模块符号不可删除则跳过
示例
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