Home > DMT_Schematic > getAllSchematicsInfo
DMT_Schematic.getAllSchematicsInfo() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
获取工程内所有原理图的详细属性
签名
typescript
function getAllSchematicsInfo(): Promise<Array<IDMT_SchematicItem>>;1
返回值
Promise<Array<IDMT_SchematicItem>>
所有原理图的详细属性的数组
示例
javascript
// 1. 创建一个测试原理图并等 1.5s 同步,保证列表里有新近创建的对象
const schematicUuid = await eda.dmt_Schematic.createSchematic();
await new Promise(r => setTimeout(r, 1500));
// 2. 获取所有原理图的详细属性
const schematics = await eda.dmt_Schematic.getAllSchematicsInfo();
// 3. 输出每个原理图的名称、UUID 与图页数,确认测试原理图在列
schematics.slice(0, 10).forEach((s, i) => {
console.log(`schematic[${i}]:`, s.name, s.uuid, 'pages:', (s.page || []).length, 'board:', s.parentBoardName ?? '游离');
});
console.log('total:', schematics.length);
console.log('testSchematicIncluded:', schematics.some(s => s.uuid === schematicUuid));
// 4. 清理测试原理图
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18