Home > LIB_SimulationModel > modify
LIB_SimulationModel.modify() 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.
Modify the simulation model
Signature
typescript
function modify(
simulationModelUuid: string,
libraryUuid: string,
modelProps?: {
modelName?: undefined | string;
modelCategory?: undefined | string;
modelPin?: undefined | string;
},
classification?: Array<string> | null,
description?: string | null,
): Promise<boolean>;1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Parameters
Parameter | Type | Description |
|---|---|---|
simulationModelUuid | string | Simulation model UUID |
libraryUuid | string | Library UUID, you can use LIB_LibrariesList APIs in |
modelProps | { modelName?: undefined | string; modelCategory?: undefined | string; modelPin?: undefined | string } | (Optional) Simulation model properties |
classification | Array<string> | null | (Optional) Classification |
description | string | null | (Optional) Description |
Returns
Promise<boolean>
Whether the operation is successful
Remarks
If you want to clear certain properties, set their values to null ADD since EDA v3.2.167
Example
javascript
// 1. 获取个人库 UUID 并新建修改对象
const libraryUuid = await eda.lib_LibrariesList.getPersonalLibraryUuid();
const simulationModelUuid = await eda.lib_SimulationModel.create(
libraryUuid,
{
modelType: 'Ngspice',
modelData: '* 示例电阻模型\n.model EXAMPLE_RES RES(R=1k)\n',
modelName: `嘉立创示例_仿真模型修改前_${Date.now()}`,
},
[],
'修改前的描述'
);
// 2. 修改名称和描述(分类保持不变传 [])
const newName = `嘉立创示例_仿真模型修改后_${Date.now()}`;
const modified = await eda.lib_SimulationModel.modify(
simulationModelUuid,
libraryUuid,
{ modelName: newName },
[],
'修改后的描述'
);
// 修改类保留现场
console.log('simulationModelUuid:', simulationModelUuid);
console.log('modified:', modified);
console.log('newName:', newName);1
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
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