Home > SYS_FileManager > getSymbolFileBySymbolUuid
SYS_FileManager.getSymbolFileBySymbolUuid() 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.
Use symbol UUID get symbol file
Signature
function getSymbolFileBySymbolUuid(
symbolUuid: string | Array<string>,
libraryUuid?: string,
fileType?: 'elibz' | 'elibz2',
): Promise<File | undefined>;2
3
4
5
Parameters
Parameter | Type | Description |
|---|---|---|
symbolUuid | string | Array<string> | Symbol UUID or symbol UUID list |
libraryUuid | string | (Optional) Library UUID. It can be obtained using the APIs in LIB_LibrariesList. If not passed in, it is the system library |
fileType | 'elibz' | 'elibz2' | (Optional) |
Returns
Promise<File | undefined>
Symbol file data, undefined indicates that the data retrieval failed
Remarks
You can use SYS_FileSystem.saveFile() API export the file to the local file system
Note: This API requires the **Team Library > Download Library** permission. Calling it without permission will always throw Error
Example
// 1. 列出系统库符号,取第一个的 UUID
const symbolList = await eda.lib_Symbol.search('', undefined, [], undefined, 5, 1);
const symbol = symbolList[0];
// 2. 按符号 UUID 获取符号文件
const symbolFile = await eda.sys_FileManager.getSymbolFileBySymbolUuid(symbol.uuid);
// 3. 输出符号与文件信息(size 单位为字节)
console.log('符号名:', symbol.name);
console.log('文件名:', symbolFile.name);
console.log('文件大小:', symbolFile.size);2
3
4
5
6
7
8
9
10
11