Home > DMT_Schematic > modifySchematicName
DMT_Schematic.modifySchematicName() 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 name
Signature
typescript
function modifySchematicName(schematicUuid: string, schematicName: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
schematicUuid | string | Schematic UUID |
schematicName | string | Schematic name |
Returns
Promise<boolean>
Whether Modify Successful
Remarks
If the schematic is already associated with a reuse block (a reuse block symbol with the same name exists in the project library), modifying the name will also modify the reuse block symbol name and the associated PCB name
Example
javascript
// 1. 创建专用测试原理图(自带图页 p1)并等 1.5s 同步
const schematicUuid = await eda.dmt_Schematic.createSchematic();
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 newName = '嘉立创示例_原理图新名称';
const renamed = await eda.dmt_Schematic.modifySchematicName(schematicUuid, newName);
console.log('renamed:', renamed);
// 4. 等 1.5s 让改名同步,回读验证(英文名可能被归一化为小写,按不区分大小写比较)
await new Promise(r => setTimeout(r, 1500));
const after = await eda.dmt_Schematic.getSchematicInfo(schematicUuid);
console.log('renamedTo:', after?.name);
console.log('renameVerified:', (after?.name ?? '').toLowerCase() === newName.toLowerCase());
// 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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24