Home > SYS_FileManager > getFootprintFileByFootprintUuid
SYS_FileManager.getFootprintFileByFootprintUuid() 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 footprint UUID get footprint file
Signature
function getFootprintFileByFootprintUuid(
footprintUuid: string | Array<string>,
libraryUuid?: string,
fileType?: 'elibz' | 'elibz2',
): Promise<File | undefined>;2
3
4
5
Parameters
Parameter | Type | Description |
|---|---|---|
footprintUuid | string | Array<string> | Footprint UUID or footprint 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>
Footprint 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 footprintList = await eda.lib_Footprint.search('', undefined, [], undefined, 5, 1);
const footprint = footprintList[0];
// 2. 按封装 UUID 获取封装文件
const footprintFile = await eda.sys_FileManager.getFootprintFileByFootprintUuid(footprint.uuid);
// 3. 输出封装与文件信息(size 单位为字节)
console.log('封装名:', footprint.name);
console.log('文件名:', footprintFile.name);
console.log('文件大小:', footprintFile.size);2
3
4
5
6
7
8
9
10
11