Home > DMT_Schematic > copySchematicPage
DMT_Schematic.copySchematicPage() 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.
Copy Schematic sheet
Signature
typescript
function copySchematicPage(
schematicPageUuid: string,
schematicUuid?: string,
): Promise<string | undefined>;1
2
3
4
2
3
4
Parameters
Parameter | Type | Description |
|---|---|---|
schematicPageUuid | string | Source schematic sheet UUID |
schematicUuid | string | (Optional) Target schematic UUID. If not specified, it is the current schematic |
Returns
Promise<string | undefined>
New schematic sheet UUID. If it is undefined, the copy failed
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 sourcePageUuid = info.page[0].uuid;
// 2. 复制该图页,目标显式指定为同一原理图,返回新图页 UUID
const copiedUuid = await eda.dmt_Schematic.copySchematicPage(sourcePageUuid, schematicUuid);
await new Promise(r => setTimeout(r, 1500));
// 3. 回读副本图页,确认名称与归属
const copyPage = await eda.dmt_Schematic.getSchematicPageInfo(copiedUuid);
console.log('copiedUuid:', copiedUuid);
console.log('copyPageName:', copyPage?.name);
console.log('belongsToSchematic:', copyPage?.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
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20