Home > DMT_Schematic > modifySchematicPageName
DMT_Schematic.modifySchematicPageName() 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.
Modify Schematic sheet name
Signature
typescript
function modifySchematicPageName(
schematicPageUuid: string,
schematicPageName: string,
): Promise<boolean>;1
2
3
4
2
3
4
Parameters
Parameter | Type | Description |
|---|---|---|
schematicPageUuid | string | Schematic sheet UUID |
schematicPageName | string | Schematic sheet name |
Returns
Promise<boolean>
Whether Modify Successful
Example
javascript
// 1. 创建专用测试原理图(自带图页 p1 作为改名目标)并等 1.5s 同步
const schematicUuid = await eda.dmt_Schematic.createSchematic();
await new Promise(r => setTimeout(r, 1500));
const info = await eda.dmt_Schematic.getSchematicInfo(schematicUuid);
const pageUuid = info.page[0].uuid;
// 2. 修改图页名称(只对本例创建的测试图页改名)
const newName = '嘉立创示例_电源页';
const renamed = await eda.dmt_Schematic.modifySchematicPageName(pageUuid, newName);
console.log('renamed:', renamed);
// 3. 等 1.5s 让改名同步,回读验证(英文名可能被归一化为小写,按不区分大小写比较)
await new Promise(r => setTimeout(r, 1500));
const after = await eda.dmt_Schematic.getSchematicPageInfo(pageUuid);
console.log('renamedTo:', after?.name);
console.log('renameVerified:', (after?.name ?? '').toLowerCase() === newName.toLowerCase());
// 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
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21