Home > LIB_SelectControl > getSelectedLibraryRowInfo
LIB_SelectControl.getSelectedLibraryRowInfo() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
获取当前底部库选中行的信息
签名
typescript
function getSelectedLibraryRowInfo(): Promise<ILIB_LibraryItem | undefined>;1
返回值
Promise<ILIB_LibraryItem | undefined>
库属性对象,如若为 undefined 则获取失败
备注
将会获取当前底部库选中行的库类型、UUID、所属库 UUID
示例
javascript
// 1. 读取当前选中行
const row = await eda.lib_SelectControl.getSelectedLibraryRowInfo();
// 2. 库类型对照(ELIB_LibraryType)
const typeNames = {
1: '复用模块',
2: '符号',
3: '器件',
4: '封装',
5: '3D 模型',
29: '面板库',
32: '仿真模型(Ngspice)',
33: '仿真模型(SimulIDE)',
};
// 3. 输出选中行的关键信息(uuid + libraryUuid 可直接传给库管理接口)
console.log('libraryType:', row.libraryType, `(${typeNames[row.libraryType] || '未知类型'})`);
console.log('uuid:', row.uuid);
console.log('libraryUuid:', row.libraryUuid);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19