Home > IPCB_PrimitiveObject > getState_Rotation
IPCB_PrimitiveObject.getState_Rotation() method
Get the property state: rotation angle
Signature
typescript
function getState_Rotation(): number;1
Returns
number
Rotation angle
Example
javascript
// 1. 生成本次运行专用的坐标,放置一个未旋转的内嵌图片
const x = 2000 + Math.floor(Math.random() * 100000);
const y = 2000 + Math.floor(Math.random() * 100000);
// 4x4 纯色 PNG 的 data URI(binaryData 必须是 data URI 格式,裸 base64 会创建失败)
const imageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAEElEQVR4nGP4z8AARwzEcQCukw/x0F8jngAAAABJRU5ErkJggg==';
const obj = await eda.pcb_PrimitiveObject.create(3, x, y, imageData, 400, 300, 0, false, 'demo.png', false);
// 2. 读取旋转角度
const rotation = obj.getState_Rotation();
// 3. 清理测试图元(查询类案例不留测试对象)
await eda.pcb_PrimitiveObject.delete([obj.getState_PrimitiveId()]);
console.log('rotation:', rotation);1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14