Home > PCB_Drc > modifyDifferentialPairPositiveNet
PCB_Drc.modifyDifferentialPairPositiveNet() 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.
Modify the positive net of the differential pair
Signature
typescript
function modifyDifferentialPairPositiveNet(
differentialPairName: string,
positiveNet: string,
): Promise<boolean>;1
2
3
4
2
3
4
Parameters
Parameter | Type | Description |
|---|---|---|
differentialPairName | string | Differential pair name |
positiveNet | string | Positive net name |
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 生成本次运行专用的网络名(避免与其他差分对冲突)
const ts = Date.now();
const netP = `JLC_DEMO_DP_P_${ts}`;
const netN = `JLC_DEMO_DP_N_${ts}`;
const newNetP = `JLC_DEMO_DP_P2_${ts}`;
// 2. 放三个带网络的焊盘并创建差分对
const x = 3000 + Math.floor(Math.random() * 20000);
await eda.pcb_PrimitivePad.create(1, '1', x, 3000, 0, ['ELLIPSE', 60, 60], netP, null, 0, 0, 0, false, 0);
await eda.pcb_PrimitivePad.create(1, '2', x + 500, 3000, 0, ['ELLIPSE', 60, 60], netN, null, 0, 0, 0, false, 0);
await eda.pcb_PrimitivePad.create(1, '3', x + 1000, 3000, 0, ['ELLIPSE', 60, 60], newNetP, null, 0, 0, 0, false, 0);
const pairName = `嘉立创示例_差分对_${ts}`;
await eda.pcb_Drc.createDifferentialPair(pairName, netP, netN);
// 3. 把正网络替换为 newNetP(保留现场供观察)
const result = await eda.pcb_Drc.modifyDifferentialPairPositiveNet(pairName, newNetP);
console.log('newPositiveNet:', newNetP);
console.log('result:', result);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19