Home > PCB_ManufactureData > getIpc2581CFile
PCB_ManufactureData.getIpc2581CFile() 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.
Get IPC-2581C file
Signature
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
Parameters
Parameter | Type | Description |
|---|---|---|
fileName | string | (Optional) File name |
fileType | 'xml' | 'cvg' | '2581' | (Optional) |
unit | (Optional) | |
oemNumber | 'Device' | 'Manufacturer Part' | 'Supplier Part' | 'Comment' | (Optional) |
Returns
Promise<File | undefined>
IPC-2581C file data
Remarks
You can use SYS_FileSystem.saveFile() API export the file to the local file system
Example
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