Home > SYS_FileManager > getProjectFileByProjectUuid
SYS_FileManager.getProjectFileByProjectUuid() 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 project UUID get project file
Signature
function getProjectFileByProjectUuid(
projectUuid: string,
fileName?: string,
password?: string,
fileType?: 'epro' | 'epro2',
): Promise<File | undefined>;2
3
4
5
6
Parameters
Parameter | Type | Description |
|---|---|---|
projectUuid | string | Project UUID |
fileName | string | (Optional) File name |
password | string | (Optional) Encrypted password |
fileType | 'epro' | 'epro2' | (Optional) File format |
Returns
Promise<File | undefined>
Project file data, undefined indicates that it is currently not open project or data retrieval failed
Remarks
You can use SYS_FileSystem.saveFile() API export the file to the local file system
Note: This API requires the **Project Management > Download Project** permission. Calling it without permission will always throw Error
Example
// 1. 获取当前工程的 UUID
const projectInfo = await eda.dmt_Project.getCurrentProjectInfo();
// 2. 按工程 UUID 下载工程文件(文件名自动带上 epro2 扩展名)
const projectFile = await eda.sys_FileManager.getProjectFileByProjectUuid(projectInfo.uuid, '嘉立创示例_按UUID导出');
// 3. 输出文件信息(size 单位为字节)
console.log('文件名:', projectFile.name);
console.log('文件大小:', projectFile.size);2
3
4
5
6
7
8
9