Home > SYS_FileManager > getCbbFileByCbbUuid
SYS_FileManager.getCbbFileByCbbUuid() 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 reuse block UUID get reuse block file
Signature
function getCbbFileByCbbUuid(
cbbUuid: string,
libraryUuid?: string,
props?: {
fileName?: undefined | string;
password?: undefined | string;
fileType?: undefined | 'epro' | 'epro2';
templateSchematicUuid?: undefined | string;
templatePcbUuid?: undefined | string;
},
): Promise<File | undefined>;2
3
4
5
6
7
8
9
10
11
Parameters
Parameter | Type | Description |
|---|---|---|
cbbUuid | string | Reuse block UUID |
libraryUuid | string | (Optional) Library UUID. It can be obtained using the APIs in LIB_LibrariesList. If not passed in, it is the system library |
props | { fileName?: undefined | string; password?: undefined | string; fileType?: undefined | 'epro' | 'epro2'; templateSchematicUuid?: undefined | string; templatePcbUuid?: undefined | string } | (Optional) |
Returns
Promise<File | undefined>
Reuse block 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 Module > Download Module** permission. Calling it without permission will always throw Error
Example
// 1. 列出系统库中的复用模块,取第一个的 UUID
const cbbList = await eda.lib_Cbb.search('', undefined, undefined, 5);
const cbb = cbbList[0];
// 2. 按复用模块 UUID 获取文件,props.fileName 指定导出文件名
const cbbFile = await eda.sys_FileManager.getCbbFileByCbbUuid(cbb.uuid, undefined, {
fileName: '嘉立创示例_复用模块',
});
// 3. 输出复用模块与文件信息(size 单位为字节)
console.log('复用模块名:', cbb.name);
console.log('文件名:', cbbFile.name);
console.log('文件大小:', cbbFile.size);2
3
4
5
6
7
8
9
10
11
12
13