Home > LIB_3DModel > modify
LIB_3DModel.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 3D model
Signature
typescript
function modify(
modelUuid: string,
libraryUuid: string,
modelName?: string,
classification?: ILIB_ClassificationIndex | Array<string> | null,
description?: string | null,
): Promise<boolean>;1
2
3
4
5
6
7
2
3
4
5
6
7
Parameters
Parameter | Type | Description |
|---|---|---|
modelUuid | string | 3D model UUID |
libraryUuid | string | Library UUID, you can use LIB_LibrariesList APIs in |
modelName | string | (Optional) 3D model name |
classification | ILIB_ClassificationIndex | 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
Example
javascript
// 1. 获取个人库 UUID
const libraryUuid = await eda.lib_LibrariesList.getPersonalLibraryUuid();
// 2. 复制一个系统库模型到个人库作为修改对象
const results = await eda.lib_3DModel.search('0402', undefined, undefined, 1);
const source = results[0];
const copiedUuid = await eda.lib_3DModel.copy(
source.uuid,
source.libraryUuid,
libraryUuid,
undefined,
`ToModify_${Date.now()}`
);
// 3. 修改名称和描述(classification 保持不变传 [])
const modifiedName = `Renamed_${Date.now()}`;
const modified = await eda.lib_3DModel.modify(
copiedUuid,
libraryUuid,
modifiedName,
[],
'3D model example'
);
// 修改类保留现场
console.log('copiedUuid:', copiedUuid);
console.log('modified:', modified);
console.log('newName:', modifiedName);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
29
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