Home > SYS_FileManager > importProjectByProjectFile
SYS_FileManager.importProjectByProjectFile() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
使用工程文件导入工程
签名
function importProjectByProjectFile(
projectFile: File,
fileType?: 'Altium Designer' | 'Protel',
props?: {
importOption?:
| undefined
| ESYS_ImportProjectImportOption.IMPORT_DOCUMENT
| ESYS_ImportProjectImportOption.EXTRACT_LIBRARIES
| ESYS_ImportProjectImportOption.IMPORT_DOCUMENT_EXTRACT_LIBRARIES;
viaSolderMaskExpansion?:
| undefined
| ESYS_ImportProjectViaSolderMaskExpansion.ALL_COVER_OIL
| ESYS_ImportProjectViaSolderMaskExpansion.FOLLOW_ORIGINAL_SETTING;
boardOutlineSource?:
| undefined
| ESYS_ImportProjectBoardOutlineSource.FROM_KEEPOUT_LAYER
| ESYS_ImportProjectBoardOutlineSource.FROM_MECHANICAL_LAYER_1;
schematicObjectStyle?:
| undefined
| ESYS_ImportProjectSchematicObjectStyle.USE_SYSTEM_THEME
| ESYS_ImportProjectSchematicObjectStyle.USE_SOURCE_FILE_STYLE;
associateFootprint?: undefined | false | true;
associate3DModel?: undefined | false | true;
importFootprintNotesLayer?: undefined | false | true;
},
saveTo?:
| {
operation: 'New Project';
newProjectOwnerTeamUuid: string;
newProjectOwnerFolderUuid?: undefined | string;
newProjectName?: undefined | string;
newProjectFriendlyName?: undefined | string;
newProjectDescription?: undefined | string;
newProjectCollaborationMode?:
| undefined
| EDMT_ProjectCollaborationMode.STRICT
| EDMT_ProjectCollaborationMode.FREE;
}
| { operation: 'Existing Project'; existingProjectUuid: string },
librariesImportSetting?: {
ownerTeamUuid: string;
deviceClassification?: undefined | string[];
symbolClassification?: undefined | string[];
footprintClassification?: undefined | string[];
createDeviceForSingleSymbol?: undefined | false | true;
updateExistingLibrariesWithTheSameName?: undefined | false | true;
},
): Promise<IDMT_BriefProjectItem | undefined>;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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
参数名
参数 | 类型 | 描述 |
|---|---|---|
projectFile | File | 工程文件 |
fileType | 'Altium Designer' | 'Protel' | (可选) 文件类型 |
props | { importOption?: undefined | ESYS_ImportProjectImportOption.IMPORT_DOCUMENT | ESYS_ImportProjectImportOption.EXTRACT_LIBRARIES | ESYS_ImportProjectImportOption.IMPORT_DOCUMENT_EXTRACT_LIBRARIES; viaSolderMaskExpansion?: undefined | ESYS_ImportProjectViaSolderMaskExpansion.ALL_COVER_OIL | ESYS_ImportProjectViaSolderMaskExpansion.FOLLOW_ORIGINAL_SETTING; boardOutlineSource?: undefined | ESYS_ImportProjectBoardOutlineSource.FROM_KEEPOUT_LAYER | ESYS_ImportProjectBoardOutlineSource.FROM_MECHANICAL_LAYER_1; schematicObjectStyle?: undefined | ESYS_ImportProjectSchematicObjectStyle.USE_SYSTEM_THEME | ESYS_ImportProjectSchematicObjectStyle.USE_SOURCE_FILE_STYLE; associateFootprint?: undefined | false | true; associate3DModel?: undefined | false | true; importFootprintNotesLayer?: undefined | false | true } | (可选) 导入参数,参考 EDA 前端 **导入** 窗口内的配置项 |
saveTo | { operation: 'New Project'; newProjectOwnerTeamUuid: string; newProjectOwnerFolderUuid?: undefined | string; newProjectName?: undefined | string; newProjectFriendlyName?: undefined | string; newProjectDescription?: undefined | string; newProjectCollaborationMode?: undefined | EDMT_ProjectCollaborationMode.STRICT | EDMT_ProjectCollaborationMode.FREE } | | (可选) 保存到工程参数 |
librariesImportSetting | { ownerTeamUuid: string; deviceClassification?: undefined | string[]; symbolClassification?: undefined | string[]; footprintClassification?: undefined | string[]; createDeviceForSingleSymbol?: undefined | false | true; updateExistingLibrariesWithTheSameName?: undefined | false | true } | (Optional) |
返回值
Promise<IDMT_BriefProjectItem | undefined>
导入的工程的简略工程属性
备注
暂不支持提取库的相关配置,如果需求提取库,将会按照默认配置提取