Home > ISCH_PrimitiveRectangle > getState_PrimitiveId
ISCH_PrimitiveRectangle.getState_PrimitiveId() method
获取属性状态:图元 ID
签名
typescript
function getState_PrimitiveId(): string;1
返回值
string
图元 ID
示例
javascript
// 1. 创建一个测试矩形(SCH 坐标单位 10mil)
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
// 2. 读取图元 ID
const primitiveId = rect.getState_PrimitiveId();
// 3. 用 ID 从画布重取矩形,验证 ID 有效
const refetched = await eda.sch_PrimitiveRectangle.get(primitiveId);
// 4. 清理测试图元(查询类案例不留测试对象)
await eda.sch_PrimitiveRectangle.delete([primitiveId]);
console.log('primitiveId:', primitiveId);
console.log('refetched width:', refetched.getState_Width());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