Home > IPCB_PrimitiveRegion > getState_RegionName
IPCB_PrimitiveRegion.getState_RegionName() method
获取属性状态:区域名称
签名
typescript
function getState_RegionName(): string | undefined;1
返回值
string | undefined
区域名称
示例
javascript
// 1. 创建一个带名称的约束区域(ruleType=9 即 FOLLOW_REGION_RULE)
const x = 2000 + Math.floor(Math.random() * 100000);
const y = 2000 + Math.floor(Math.random() * 100000);
const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
const region = await eda.pcb_PrimitiveRegion.create(1, polygon, [9], '嘉立创示例_电源约束区');
// 2. 读取区域名称
const regionName = region.getState_RegionName();
// 3. 清理测试图元(查询类案例不留测试对象)
await eda.pcb_PrimitiveRegion.delete([region.getState_PrimitiveId()]);
console.log('regionName:', regionName);1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13