Home > PCB_Drc > removeNetFromNetClass
PCB_Drc.removeNetFromNetClass() 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.
From net class in remove net
Signature
typescript
function removeNetFromNetClass(netClassName: string, net: string | Array<string>): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
netClassName | string | Net class name |
net | string | Array<string> | Net name |
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 准备两个真实网络(放带网络的测试焊盘)
const x = 3000 + Math.floor(Math.random() * 20000);
await eda.pcb_PrimitivePad.create(1, '1', x, 3000, 0, ['ELLIPSE', 60, 60], 'JLC_DEMO_P', null, 0, 0, 0, false, 0);
await eda.pcb_PrimitivePad.create(1, '2', x + 500, 3000, 0, ['ELLIPSE', 60, 60], 'JLC_DEMO_N', null, 0, 0, 0, false, 0);
// 2. 建网络类并纳入网络
await eda.pcb_Drc.createNetClass('嘉立创示例_网络类', ['JLC_DEMO_P', 'JLC_DEMO_N'], { r: 255, g: 0, b: 0, alpha: 1 });
// 3. 先单个移除,再批量移除
const removedOne = await eda.pcb_Drc.removeNetFromNetClass('嘉立创示例_网络类', 'JLC_DEMO_P');
const removedBatch = await eda.pcb_Drc.removeNetFromNetClass('嘉立创示例_网络类', ['JLC_DEMO_N']);
console.log('removedOne:', removedOne);
console.log('removedBatch:', removedBatch);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