Home > DMT_Schematic > 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.
Delete Schematic
Signature
typescript
function deleteSchematic(schematicUuid: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
schematicUuid | string | Schematic UUID |
Returns
Promise<boolean>
Whether the operation is successful
Remarks
If the schematic is already associated with a reuse block (a reuse block symbol with the same name exists in the project library), deleting the schematic will also delete the associated PCB and reuse block symbol. If the reuse block symbol cannot be deleted, it will be skipped
Example
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