Home > DMT_Board > getCurrentBoardInfo
DMT_Board.getCurrentBoardInfo() method
Get detailed properties of Current board
Signature
typescript
function getCurrentBoardInfo(): Promise<IDMT_BoardItem | undefined>;1
Returns
Promise<IDMT_BoardItem | undefined>
Board detailed properties of; if it is undefined, the retrieval failed
Remarks
It will get the detailed properties of the board associated with the currently open schematic or PCB that has the last input focus
Example
javascript
// 1. 切换到第一块板子下属的 PCB 文档(工程里可能存在不属于任何板子的 PCB,不能直接取 getAllPcbsInfo()[0])
const boards = await eda.dmt_Board.getAllBoardsInfo();
await eda.dmt_EditorControl.openDocument(boards[0].pcb.uuid);
await new Promise(r => setTimeout(r, 500));
// 2. 获取当前焦点对应的板子
const board = await eda.dmt_Board.getCurrentBoardInfo();
// 3. 输出板子属性
console.log('name:', board.name);
console.log('schematic:', board.schematic?.uuid);
console.log('pcb:', board.pcb?.uuid);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12