Home > DMT_Schematic > deleteSchematic
DMT_Schematic.deleteSchematic() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
删除原理图
签名
typescript
function deleteSchematic(schematicUuid: string): Promise<boolean>;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
schematicUuid | string | 原理图 UUID |
返回值
Promise<boolean>
操作是否成功
备注
如若原理图已关联复用模块(在工程库内存在同名的复用模块符号),则删除原理图时将同步删除关联的 PCB 和复用模块符号,复用模块符号不可删除则跳过
示例
javascript
// 1. 创建专用测试原理图(避免误删工程里的现有原理图),等 1.5s 同步
const schematicUuid = await eda.dmt_Schematic.createSchematic();
await new Promise(r => setTimeout(r, 1500));
// 2. 删除该原理图
const deleted = await eda.dmt_Schematic.deleteSchematic(schematicUuid);
console.log('deleted:', deleted);
// 3. 回读确认已删除(返回 undefined 说明原理图已不存在)
await new Promise(r => setTimeout(r, 1500));
const info = await eda.dmt_Schematic.getSchematicInfo(schematicUuid);
console.log('info after delete:', info === undefined ? '已不存在' : info.name);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12