Home > SYS_FileManager > importProjectByProjectFile
SYS_FileManager.importProjectByProjectFile() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
使用工程文件导入工程
签名
importProjectByProjectFile(projectFile: File, fileType?: 'Altium Designer' | 'Protel', props?: {
importOption?: EImportOptionType;
viaSolderMaskExpansion?: EViaSolderMaskExpansion;
boardOutlineSource?: EBoardOutlineSourceType;
schematicObjectStyle?: ESchPrimitiveStyle;
associateFootprint?: boolean;
associate3DModel?: boolean;
importFootprintNotesLayer?: boolean;
}, saveTo?: {
operation: 'New Project';
newProjectOwnerTeamUuid: IDMT_TeamItem['uuid'];
newProjectOwnerFolderUuid?: IDMT_FolderItem['uuid'];
newProjectName?: string;
newProjectFriendlyName?: string;
newProjectDescription?: string;
newProjectCollaborationMode?: EDMT_ProjectCollaborationMode;
} | {
operation: 'Existing Project';
existingProjectUuid: IDMT_BriefProjectItem['uuid'];
}, librariesImportSetting?: {
ownerTeamUuid: IDMT_TeamItem['uuid'];
createDeviceForSingleSymbol?: boolean;
}): 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
参数名
参数 | 类型 | 描述 |
|---|---|---|
projectFile | File | 工程文件 |
fileType | 'Altium Designer' | 'Protel' | (Optional) 文件类型 |
props | { importOption?: EImportOptionType; viaSolderMaskExpansion?: EViaSolderMaskExpansion; boardOutlineSource?: EBoardOutlineSourceType; schematicObjectStyle?: ESchPrimitiveStyle; associateFootprint?: boolean; associate3DModel?: boolean; importFootprintNotesLayer?: boolean; } | (Optional) 导入参数,参考 EDA 前端 **导入** 窗口内的配置项 |
saveTo | { operation: 'New Project'; newProjectOwnerTeamUuid: IDMT_TeamItem['uuid']; newProjectOwnerFolderUuid?: IDMT_FolderItem['uuid']; newProjectName?: string; newProjectFriendlyName?: string; newProjectDescription?: string; newProjectCollaborationMode?: EDMT_ProjectCollaborationMode; } | { operation: 'Existing Project'; existingProjectUuid: IDMT_BriefProjectItem['uuid']; } | (Optional) 保存到工程参数 |
librariesImportSetting | { ownerTeamUuid: IDMT_TeamItem['uuid']; createDeviceForSingleSymbol?: boolean; } | (Optional) |
返回值
Promise<IDMT_BriefProjectItem | undefined>
导入的工程的简略工程属性
备注
暂不支持提取库的相关配置,如果需求提取库,将会按照默认配置提取