Home > DMT_EditorControl > getSplitScreenTree
DMT_EditorControl.getSplitScreenTree() method
Get the editor split screen property tree
Signature
typescript
function getSplitScreenTree(): Promise<IDMT_EditorSplitScreenItem | undefined>;1
Returns
Promise<IDMT_EditorSplitScreenItem | undefined>
The editor split screen property tree. If it is undefined, the data retrieval failed
Example
javascript
// 1. 打开一个原理图页,保证分屏树里有标签页可读
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
// 2. 读取分屏树
const tree = await eda.dmt_EditorControl.getSplitScreenTree();
// 3. 递归遍历,收集所有分屏 ID 与标签页标题
const splitIds = [];
const tabTitles = [];
(function walk(node) {
splitIds.push(node.id);
if (node.tabs)
tabTitles.push(...node.tabs.map(t => t.title));
(node.children || []).forEach(walk);
})(tree);
console.log('split count:', splitIds.length);
console.log('tab titles:', tabTitles);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18