Home > ISCH_PrimitivePin > getState_PinColor
ISCH_PrimitivePin.getState_PinColor() method
获取属性状态:引脚颜色
签名
typescript
public getState_PinColor(): string | null;1
返回值
string | null
引脚颜色
示例
javascript
// 0. 确保当前文档是符号编辑器:优先复用测试符号,没有则新建后打开
const libUuid = await eda.lib_LibrariesList.getPersonalLibraryUuid();
const found = await eda.lib_Symbol.search('嘉立创示例_Pin测试符号', libUuid);
const symUuid = found[0] ? found[0].uuid : await eda.lib_Symbol.create(libUuid, '嘉立创示例_Pin测试符号');
await eda.lib_Symbol.openInEditor(symUuid, libUuid);
// 1. 在符号画布上创建一个测试引脚,指定颜色 #0000FF
const pin = await eda.sch_PrimitivePin.create(400, 300, '1', 'CLK', 0, 10, '#0000FF', 'None', 'IN');
// 2. 读取引脚颜色
const pinColor = pin.getState_PinColor();
// 3. 清理测试引脚(查询类需要清理)
await eda.sch_PrimitivePin.delete([pin.getState_PrimitiveId()]);
console.log('pinColor:', pinColor);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16