Home > DMT_Schematic > createSchematicPage
DMT_Schematic.createSchematicPage() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
创建原理图图页
签名
typescript
public createSchematicPage(schematicUuid: string): Promise<string | undefined>;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
schematicUuid | string | 所属原理图 UUID |
返回值
Promise<string | undefined>
原理图图页 UUID,如若为 undefined 则创建失败
示例
javascript
// 1. 创建专用测试原理图(自带图页 p1),等 1.5s 同步
const schematicUuid = await eda.dmt_Schematic.createSchematic();
await new Promise(r => setTimeout(r, 1500));
// 2. 在该原理图下创建新图页,返回图页 UUID
const pageUuid = await eda.dmt_Schematic.createSchematicPage(schematicUuid);
console.log('pageUuid:', pageUuid);
// 3. 等 1.5s 同步,回读图页属性,确认归属
await new Promise(r => setTimeout(r, 1500));
const pageInfo = await eda.dmt_Schematic.getSchematicPageInfo(pageUuid);
console.log('pageName:', pageInfo?.name);
console.log('belongsToSchematic:', pageInfo?.parentSchematicUuid === 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