Home > SCH_ManufactureData > getBomFile
SCH_ManufactureData.getBomFile() 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 BOM file
Signature
public getBomFile(fileName?: string, fileType?: 'xlsx' | 'csv', template?: string, filterOptions?: Array<{ property: string; includeValue: string | false | true }>, statistics?: Array<string>, property?: Array<string>, columns?: Array<IPCB_BomPropertiesTableColumns>, assemblyVariantsConfig?: { text: string; value: string }): Promise<File | undefined>;Parameters
Parameter | Type | Description |
|---|---|---|
fileName | string | (Optional) File name |
fileType | 'xlsx' | 'csv' | (Optional) File type |
template | string | (Optional) Template name |
filterOptions | Array<{ property: string; includeValue: string | false | true }> | (Optional) Filter rules, which should only contain the rules to be enabled. |
statistics | Array<string> | (Optional) Statistics, containing the names of all statistic items to be enabled |
property | Array<string> | (Optional) Properties, containing the names of all properties to be enabled |
columns | (Optional) Column properties and sorting. If | |
assemblyVariantsConfig | { text: string; value: string } | (Optional) Assembly variants configuration |
Returns
Promise<File | undefined>
BOM file data
Remarks
You can use SYS_FileSystem.saveFile() API export the file to the local file system
Example
// 1. 导出 xlsx 格式 BOM,只包含标记了加入 BOM 的元件
const bomFile = await eda.sch_ManufactureData.getBomFile(
'嘉立创示例_BOM',
'xlsx',
undefined,
[{ property: 'Add into BOM', includeValue: 'yes' }]
);
// 2. 查看导出结果
console.log('导出文件名:', bomFile?.name);
console.log('文件大小:', bomFile?.size);2
3
4
5
6
7
8
9
10
11