Home > PCB_Drc > overwriteNetByNetRules
PCB_Drc.overwriteNetByNetRules() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Overwrite net - net rules
Signature
typescript
function overwriteNetByNetRules(netByNetRules: Record<string, any>): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
netByNetRules | Record<string, any> | Net - net rules |
Returns
Promise<boolean>
Overwrite whether it is successful
Remarks
It will overwrite all net-by-net rules of the current PCB. Please note the risk of data loss
Example
javascript
// 1. 读取当前所有网络-网络规则(对象,键是规则类别名)
const netByNetRules = await eda.pcb_Drc.getNetByNetRules();
// 2. 整体写回(原样写回演示覆写成功,实际使用时可先修改对象字段)
const result = await eda.pcb_Drc.overwriteNetByNetRules(netByNetRules);
console.log('ruleKeys:', Object.keys(netByNetRules).join(', '));
console.log('result:', result);1
2
3
4
5
6
7
8
2
3
4
5
6
7
8