Home > DMT_Panel > getCurrentPanelInfo
DMT_Panel.getCurrentPanelInfo() method
Get detailed properties of Current panel
Signature
typescript
function getCurrentPanelInfo(): Promise<IDMT_PanelItem | undefined>;1
Returns
Promise<IDMT_PanelItem | undefined>
Panel detailed properties of; if it is undefined, the retrieval failed
Remarks
It will get the detailed properties of the currently open panel that has the last input focus
Example
javascript
// 1. 创建测试面板并打开它,让焦点落到面板文档上(原理图/PCB 焦点下返回 undefined)
const panelUuid = await eda.dmt_Panel.createPanel();
await new Promise(r => setTimeout(r, 1500));
await eda.dmt_EditorControl.openDocument(panelUuid);
await new Promise(r => setTimeout(r, 1000));
// 2. 获取当前焦点面板的详细属性
const panel = await eda.dmt_Panel.getCurrentPanelInfo();
// 3. 输出面板的名称、UUID 与所属工程
console.log('name:', panel?.name);
console.log('panelUuid:', panel?.uuid);
console.log('parentProjectUuid:', panel?.parentProjectUuid);
// 4. 清理测试面板(面板处于打开状态也可以直接删除)
await eda.dmt_Panel.deletePanel(panelUuid);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16