Home > DMT_EditorControl > openDocument
DMT_EditorControl.openDocument() method
Open document
Signature
typescript
function openDocument(documentUuid: string, splitScreenId?: string): Promise<string | undefined>;1
Parameters
Parameter | Type | Description |
|---|---|---|
documentUuid | string | Document UUID. Here IDMT_SchematicItem.uuid, IDMT_SchematicPageItem.uuid, IDMT_PcbItem.uuid, and IDMT_PanelItem.uuid are supported as input |
splitScreenId | string | (Optional) Split screen ID, which is the IDMT_EditorSplitScreenItem.id obtained by the DMT_EditorControl.getSplitScreenTree() method |
Returns
Promise<string | undefined>
Tab ID, if it is undefined, then open document failed
Example
javascript
// 1. 取工程里第一个原理图页作为打开目标
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
console.log('target:', pages[0].name);
// 2. 打开该页面,返回标签页 ID
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
console.log('tabId:', tabId);1
2
3
4
5
6
7
2
3
4
5
6
7