Home > LIB_Symbol > create
LIB_Symbol.create() 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.
Create Symbol
Signature
typescript
function create(
libraryUuid: string,
symbolName: string,
classification?: ILIB_ClassificationIndex | Array<string>,
symbolType?: ELIB_SymbolType,
description?: string,
): Promise<string | undefined>;1
2
3
4
5
6
7
2
3
4
5
6
7
Parameters
Parameter | Type | Description |
|---|---|---|
libraryUuid | string | Library UUID, you can use LIB_LibrariesList APIs in |
symbolName | string | Symbol name |
classification | ILIB_ClassificationIndex | Array<string> | (Optional) Classification |
symbolType | (Optional) Symbol type | |
description | string | (Optional) Description |
Returns
Promise<string | undefined>
Symbol UUID
Example
javascript
// 1. 获取个人库 UUID
const libraryUuid = await eda.lib_LibrariesList.getPersonalLibraryUuid();
// 2. 创建符号(分类传 [] = 不分类;符号类型 '1' = 原理图符号,见 ELIB_SymbolType)
const symbolName = `嘉立创示例_新符号_${Date.now()}`;
const symbolUuid = await eda.lib_Symbol.create(libraryUuid, symbolName, [], '1', '示例符号描述');
// 创建类保留现场(新符号留在个人库中供观察)
console.log('symbolUuid:', symbolUuid);
console.log('symbolName:', symbolName);1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11