Home > PCB_Drc > addNetToEqualLengthNetGroup
PCB_Drc.addNetToEqualLengthNetGroup() 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.
Add a net to an equal-length net group
Signature
typescript
function addNetToEqualLengthNetGroup(
equalLengthNetGroupName: string,
net: string | Array<string>,
): Promise<boolean>;1
2
3
4
2
3
4
Parameters
Parameter | Type | Description |
|---|---|---|
equalLengthNetGroupName | string | Equal-length net group 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_D0', null, 0, 0, 0, false, 0);
await eda.pcb_PrimitivePad.create(1, '2', x + 500, 3000, 0, ['ELLIPSE', 60, 60], 'JLC_DEMO_D1', null, 0, 0, 0, false, 0);
await eda.pcb_PrimitivePad.create(1, '3', x + 1000, 3000, 0, ['ELLIPSE', 60, 60], 'JLC_DEMO_D2', null, 0, 0, 0, false, 0);
// 2. 先建空等长组,再逐个/批量添加网络
await eda.pcb_Drc.createEqualLengthNetGroup('嘉立创示例_等长网络组', [], { r: 0, g: 255, b: 0, alpha: 1 });
const addedOne = await eda.pcb_Drc.addNetToEqualLengthNetGroup('嘉立创示例_等长网络组', 'JLC_DEMO_D0');
const addedBatch = await eda.pcb_Drc.addNetToEqualLengthNetGroup('嘉立创示例_等长网络组', ['JLC_DEMO_D1', 'JLC_DEMO_D2']);
console.log('addedOne:', addedOne);
console.log('addedBatch:', addedBatch);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