Home > PCB_Document > zoomToBoardOutline
PCB_Document.zoomToBoardOutline() 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.
Zoom to the board outline (fit the board outline)
Signature
typescript
function zoomToBoardOutline(): Promise<boolean>;1
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
const pcbUuid = await eda.dmt_Pcb.createPcb();
await new Promise(r => setTimeout(r, 1500));
await eda.dmt_EditorControl.openDocument(pcbUuid);
await new Promise(r => setTimeout(r, 1000));
// 2. 缩放到板框
const zoomed = await eda.pcb_Document.zoomToBoardOutline();
console.log('zoomed:', zoomed);
// 3. 清理测试 PCB
await eda.dmt_Pcb.deletePcb(pcbUuid);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12