Home > PCB_Drc > createDifferentialPair
PCB_Drc.createDifferentialPair() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
创建差分对
签名
typescript
function createDifferentialPair(
differentialPairName: string,
positiveNet: string,
negativeNet: string,
): Promise<boolean>;1
2
3
4
5
2
3
4
5
参数名
参数 | 类型 | 描述 |
|---|---|---|
differentialPairName | string | 差分对名称 |
positiveNet | string | 正网络名称 |
negativeNet | string | 负网络名称 |
返回值
Promise<boolean>
操作是否成功
示例
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