Home > PCB_ManufactureData > getIpc2581CFile
PCB_ManufactureData.getIpc2581CFile() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
获取 IPC-2581C 文件
签名
typescript
function getIpc2581CFile(
fileName?: string,
fileType?: 'xml' | 'cvg' | '2581',
unit?: ESYS_Unit.INCH | ESYS_Unit.MILLIMETER,
oemNumber?: 'Device' | 'Manufacturer Part' | 'Supplier Part' | 'Comment',
): Promise<File | undefined>;1
2
3
4
5
6
2
3
4
5
6
参数名
参数 | 类型 | 描述 |
|---|---|---|
fileName | string | (可选) 文件名 |
fileType | 'xml' | 'cvg' | '2581' | (Optional) |
unit | (Optional) | |
oemNumber | 'Device' | 'Manufacturer Part' | 'Supplier Part' | 'Comment' | (Optional) |
返回值
Promise<File | undefined>
IPC-2581C 文件数据
备注
可以使用 SYS_FileSystem.saveFile() 接口将文件导出到本地文件系统
示例
javascript
// 1. 发起导出(XML 格式、毫米单位、OEM 编号取元件的 Device 属性),
// 25 秒内完成就输出文件信息
const ipcFile = await Promise.race([
eda.pcb_ManufactureData.getIpc2581CFile('嘉立创示例_IPC2581C', 'xml', 'mm', 'Device'),
new Promise(resolve => setTimeout(() => resolve(undefined), 25000))
]);
// 2. 查看导出结果
if (ipcFile) {
console.log('导出文件名:', ipcFile.name);
console.log('文件大小:', ipcFile.size);
}
else {
console.log('导出超过 25 秒仍在后台进行,真实使用直接 await 等待完成即可');
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15