Home > DMT_EditorControl > activateDocument
DMT_EditorControl.activateDocument() method
Activate a document
Signature
typescript
function activateDocument(tabId: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
tabId | string | Tab ID |
Returns
Promise<boolean>
Whether the operation is successful
Remarks
Switch to the tab of the specified document and place the input focus in it
Example
javascript
// 1. 先后打开原理图页与 PCB,此时焦点在最后打开的 PCB 上
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
const tabSch = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
// 2. 激活原理图标签页(真实切换回原理图画布)
const activated = await eda.dmt_EditorControl.activateDocument(tabSch);
console.log('activated:', activated);1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9