Home > DMT_Schematic > createSchematicPage
DMT_Schematic.createSchematicPage() 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.
Create Schematic sheet
Signature
typescript
function createSchematicPage(schematicUuid: string): Promise<string | undefined>;1
Parameters
Parameter | Type | Description |
|---|---|---|
schematicUuid | string | UUID of the schematic it belongs to |
Returns
Promise<string | undefined>
Schematic sheet UUID, if it is undefined creation fails
Example
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