English
Home > DMT_Project > openProject
DMT_Project.openProject() method
Open project
Signature
typescript
function openProject(projectUuid: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
projectUuid | string | Project UUID |
Returns
Promise<boolean>
Whether Successful open project
Remarks
This operation will open the specified project in the EDA front end. If another project was previously opened with unsaved changes, executing this operation will directly lose all unsaved data
**画布 API 前置条件**:仅打开工程不会激活任何文档
调用 SCH_Netlist.getNetlist()、SCH_PrimitiveComponent.getAllPrimitiveId()、、PCB_Drc、PCB_Document 等画布 API 前,必须先通过 openDocument 打开目标文档,并等待 waitForDocumentReady 完成
Source 系列接口不要求打开文档,但仍需遵守其异步落盘时序
**工程树异步更新**:openProject 返回后工程树可能仍在刷新;读取列表或按名称访问得到旧数据时,先调用 waitForReady 等待后重试
Example
javascript
// 1. 取当前工程 UUID(打开自身,避免切换到其它工程)
const info = await eda.dmt_Project.getCurrentProjectInfo();
const projectUuid = info.uuid;
// 2. 打开该工程
const opened = await eda.dmt_Project.openProject(projectUuid);
console.log('opened:', opened);1
2
3
4
5
6
7
8
2
3
4
5
6
7
8