Home > PCB_ManufactureData > get3DFile
PCB_ManufactureData.get3DFile() 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 3D model file
Signature
function get3DFile(
fileName?: string,
fileType?: 'step' | 'obj',
element?: Array<'Component Model' | 'Via' | 'Silkscreen' | 'Wire In Signal Layer'>,
modelMode?: 'Outfit' | 'Parts',
autoGenerateModels?: boolean,
): Promise<File | undefined>;2
3
4
5
6
7
Parameters
Parameter | Type | Description |
|---|---|---|
fileName | string | (Optional) File name |
fileType | 'step' | 'obj' | (Optional) File type |
element | Array<'Component Model' | 'Via' | 'Silkscreen' | 'Wire In Signal Layer'> | (Optional) Exported objects |
modelMode | 'Outfit' | 'Parts' | (Optional) Export mode. |
autoGenerateModels | boolean | (Optional) Whether to automatically generate a 3D model for components not bound to a 3D model (based on the "height" property of the component) |
Returns
Promise<File | undefined>
3D model file data
Remarks
Please note: only component models imported in STEP format can be reflected in the exported STEP file
You can use SYS_FileSystem.saveFile() API export the file to the local file system
Example
// 导出装配体模式的 STEP 文件(包含元件模型)
const stepFile = await eda.pcb_ManufactureData.get3DFile(
'MyBoard_3D',
'step',
['Component Model'],
'Outfit',
true
);
if (stepFile) {
await eda.sys_FileSystem.saveFile(stepFile);
}
// 导出包含多种对象的完整 3D 模型
const full3DFile = await eda.pcb_ManufactureData.get3DFile(
'Complete_3D_Model',
'step',
['Component Model', 'Via', 'Silkscreen', 'Wire In Signal Layer'],
'Outfit',
true
);
// 导出零件模式 OBJ 文件
const objFile = await eda.pcb_ManufactureData.get3DFile(
'MyBoard_OBJ',
'obj',
['Component Model'],
'Parts',
false
);2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29