Home > PCB_Drc > createDifferentialPair
PCB_Drc.createDifferentialPair() 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.
Create a differential pair
Signature
typescript
function createDifferentialPair(
differentialPairName: string,
positiveNet: string,
negativeNet: string,
): Promise<boolean>;1
2
3
4
5
2
3
4
5
Parameters
Parameter | Type | Description |
|---|---|---|
differentialPairName | string | Differential pair name |
positiveNet | string | Positive net name |
negativeNet | string | Negative 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}`;
// 2. 放两个带差分网络的焊盘,让网络进入网表
const x = 3000 + Math.floor(Math.random() * 20000);
const padP = await eda.pcb_PrimitivePad.create(1, '1', x, 3000, 0, ['ELLIPSE', 60, 60], netP, null, 0, 0, 0, false, 0);
const padN = await eda.pcb_PrimitivePad.create(1, '2', x + 500, 3000, 0, ['ELLIPSE', 60, 60], netN, null, 0, 0, 0, false, 0);
// 3. 创建差分对(保留现场供观察)
const created = await eda.pcb_Drc.createDifferentialPair(`嘉立创示例_差分对_${ts}`, netP, netN);
console.log('pairName:', `嘉立创示例_差分对_${ts}`);
console.log('created:', created);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