Home > DMT_EditorControl > openLibraryDocument
DMT_EditorControl.openLibraryDocument() 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.
Open library symbol, footprint document
Signature
typescript
function openLibraryDocument(
libraryUuid: string,
libraryType: ELIB_LibraryType.SYMBOL | ELIB_LibraryType.FOOTPRINT,
uuid: string,
splitScreenId?: string,
): Promise<string | undefined>;1
2
3
4
5
6
2
3
4
5
6
Parameters
Parameter | Type | Description |
|---|---|---|
libraryUuid | string | Library UUID, you can use LIB_LibrariesList APIs in |
libraryType | Library type, support symbol and footprint | |
uuid | string | Symbol, footprint UUID |
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. 搜索库符号,拿到其所在库 UUID 与符号 UUID
const results = await eda.lib_Symbol.search('0603');
console.log('symbol:', results[0].name);
// 2. 打开该符号的编辑画布,返回标签页 ID('2' = ELIB_LibraryType.SYMBOL)
const tabId = await eda.dmt_EditorControl.openLibraryDocument(results[0].libraryUuid, '2', results[0].uuid);
console.log('tabId:', tabId);
// 3. 看完关闭标签页
const closed = await eda.dmt_EditorControl.closeDocument(tabId);
console.log('closed:', closed);1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11