DMT_Panel.copyPanel() method
Copy Panel
Signature
typescript
function copyPanel(panelUuid: string): Promise<string | undefined>;1
Parameters
Parameter | Type | Description |
|---|---|---|
panelUuid | string | Source panel UUID |
Returns
Promise<string | undefined>
New panel UUID. If it is undefined, the copy failed
Example
javascript
// 1. 创建一个专用源面板并等 1.5s 同步(复制前源面板必须已在工作区落地)
const sourceUuid = await eda.dmt_Panel.createPanel();
await new Promise(r => setTimeout(r, 1500));
// 2. 复制源面板,返回副本 UUID
const copiedUuid = await eda.dmt_Panel.copyPanel(sourceUuid);
await new Promise(r => setTimeout(r, 1500));
// 3. 回读副本,确认名称与所属工程
const copyInfo = await eda.dmt_Panel.getPanelInfo(copiedUuid);
console.log('copiedUuid:', copiedUuid);
console.log('copyName:', copyInfo?.name);
// 4. 清理本例创建的两个面板(先删副本再删源),保持工程整洁
const deletedCopy = await eda.dmt_Panel.deletePanel(copiedUuid);
console.log('deleted:', deletedCopy);
const deletedSource = await eda.dmt_Panel.deletePanel(sourceUuid);
console.log('deleted:', deletedSource);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