Home > DMT_Schematic > deleteSchematicPage
DMT_Schematic.deleteSchematicPage() 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 sheet
Signature
typescript
function deleteSchematicPage(schematicPageUuid: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
schematicPageUuid | string | Schematic sheet UUID |
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 创建专用测试原理图(自带图页 p1),等 1.5s 同步
const schematicUuid = await eda.dmt_Schematic.createSchematic();
await new Promise(r => setTimeout(r, 1500));
// 2. 再追加一个测试图页 p2 作为删除目标
const pageUuid = await eda.dmt_Schematic.createSchematicPage(schematicUuid);
await new Promise(r => setTimeout(r, 1500));
// 3. 删除测试图页 p2(只删这一页,原理图保留)
const deleted = await eda.dmt_Schematic.deleteSchematicPage(pageUuid);
console.log('deleted:', deleted);
// 4. 回读确认:图页已不存在,原理图回到只剩 p1
await new Promise(r => setTimeout(r, 1500));
const pageInfo = await eda.dmt_Schematic.getSchematicPageInfo(pageUuid);
console.log('page after delete:', pageInfo === undefined ? '已不存在' : pageInfo.name);
const info = await eda.dmt_Schematic.getSchematicInfo(schematicUuid);
console.log('remaining pages:', (info?.page || []).map(p => p.name).join(', '));
// 5. 清理测试原理图
await new Promise(r => setTimeout(r, 1000));
const deletedSch = await eda.dmt_Schematic.deleteSchematic(schematicUuid);
console.log('deleted:', deletedSch);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23