Home > DMT_Schematic > getCurrentSchematicAllSchematicPagesInfo
DMT_Schematic.getCurrentSchematicAllSchematicPagesInfo() 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.
Get the detailed properties of all schematic sheets in the current schematic
Signature
typescript
public getCurrentSchematicAllSchematicPagesInfo(): Promise<Array<IDMT_SchematicPageItem>>;1
Returns
Promise<Array<IDMT_SchematicPageItem>>
Array of detailed properties of all schematic sheets
Example
javascript
// 1. 创建专用测试原理图(自带图页 p1)并追加一页
const schematicUuid = await eda.dmt_Schematic.createSchematic();
await new Promise(r => setTimeout(r, 1500));
await eda.dmt_Schematic.createSchematicPage(schematicUuid);
await new Promise(r => setTimeout(r, 1500));
// 2. 打开测试原理图的自带图页 p1,把焦点切到该原理图上
const info = await eda.dmt_Schematic.getSchematicInfo(schematicUuid);
await eda.dmt_EditorControl.openDocument(info.page[0].uuid);
await new Promise(r => setTimeout(r, 1000));
// 3. 获取当前原理图内所有图页的详细属性
const pages = await eda.dmt_Schematic.getCurrentSchematicAllSchematicPagesInfo();
// 4. 输出每页名称与 UUID,确认全部归属当前原理图
pages.forEach((p, i) => {
console.log(`page[${i}]:`, p.name, p.uuid);
});
console.log('total:', pages.length);
console.log('allBelongToCurrent:', pages.every(p => p.parentSchematicUuid === schematicUuid));
// 5. 清理测试原理图(处于打开状态也可以直接删除)
await new Promise(r => setTimeout(r, 1000));
const deleted = await eda.dmt_Schematic.deleteSchematic(schematicUuid);
console.log('deleted:', deleted);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25