Home > PCB_SelectControl > doCrossProbeSelect
PCB_SelectControl.doCrossProbeSelect() 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.
Perform cross-probe selection
Signature
typescript
function doCrossProbeSelect(
components?: Array<string>,
pins?: Array<string>,
nets?: Array<string>,
highlight?: boolean,
select?: boolean,
): Promise<boolean>;1
2
3
4
5
6
7
2
3
4
5
6
7
Parameters
Parameter | Type | Description |
|---|---|---|
components | Array<string> | (Optional) Device designator |
pins | Array<string> | (Optional) Device designator _ pin number, format is ['U1_1', 'U1_2'] |
nets | Array<string> | (Optional) Net name |
highlight | boolean | (Optional) Whether to highlight |
select | boolean | (Optional) Whether the operation is successful |
Returns
Promise<boolean>
Example
javascript
// 1. 创建 2 个挂同一网络的测试焊盘,作为交叉选择的目标
const netName = '嘉立创示例_NET';
const pad1 = await eda.pcb_PrimitivePad.create(1, '1', 2000, 2000, 0, ['ELLIPSE', 60, 60], netName, null, 0, 0, 0, false, 0);
const pad2 = await eda.pcb_PrimitivePad.create(1, '2', 3000, 2000, 0, ['ELLIPSE', 60, 60], netName, null, 0, 0, 0, false, 0);
const padIds = [pad1.getState_PrimitiveId(), pad2.getState_PrimitiveId()];
// 2. 按网络名交叉选择(highlight=true 高亮,select=true 选中)
const crossProbed = await eda.pcb_SelectControl.doCrossProbeSelect(undefined, undefined, [netName], true, true);
console.log('crossProbed:', crossProbed);
// 3. 确认该网络上的焊盘已进入选中集
const selectedIds = await eda.pcb_SelectControl.getAllSelectedPrimitives_PrimitiveId();
console.log('选中图元数量:', selectedIds.length);
// 4. 清理选中状态和测试图元
await eda.pcb_SelectControl.clearSelected();
await eda.pcb_PrimitivePad.delete(padIds);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17