Home > IPCB_PrimitiveVia > setState_DesignRuleBlindViaName
IPCB_PrimitiveVia.setState_DesignRuleBlindViaName() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
设置属性状态:盲埋孔设计规则项名称
签名
typescript
function setState_DesignRuleBlindViaName(designRuleBlindViaName: string | null): IPCB_PrimitiveVia;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
designRuleBlindViaName | string | null | 盲埋孔设计规则项名称 |
返回值
过孔图元对象
示例
javascript
// 1. 生成本次运行专用的坐标,放置一个普通通孔(无规则项名称)
const x = 3000 + Math.floor(Math.random() * 100000);
const via = await eda.pcb_PrimitiveVia.create('', x, 3000, 20, 40);
const before = via.getState_DesignRuleBlindViaName();
// 2. 异步模式下关联规则项名称并提交
const a = via.toAsync();
a.setState_DesignRuleBlindViaName('嘉立创示例_盲孔');
await a.done();
// 3. 名称需与设计规则中的盲埋孔项匹配才落画布,未匹配时从图元对象本地读取
const after = via.getState_DesignRuleBlindViaName();
// 4. 保留现场供观察
console.log('designRuleBlindViaName:', before, '→', after);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15