Home > ISCH_PrimitivePin > getState_Rotation
ISCH_PrimitivePin.getState_Rotation() method
获取属性状态:旋转角度
签名
typescript
public getState_Rotation(): number;1
返回值
number
旋转角度
示例
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. 在符号画布上创建一个测试引脚,旋转 90 度(朝上)
const pin = await eda.sch_PrimitivePin.create(400, 300, '1', 'CLK', 90, 10, null, 'None', 'IN');
// 2. 读取旋转角度
const rotation = pin.getState_Rotation();
// 3. 清理测试引脚(查询类需要清理)
await eda.sch_PrimitivePin.delete([pin.getState_PrimitiveId()]);
console.log('rotation:', rotation);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