PCB_Net.getNet() 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.
Get Specify detailed information of the net
Signature
typescript
function getNet(net: string): Promise<IPCB_NetInfo | undefined>;1
Parameters
Parameter | Type | Description |
|---|---|---|
net | string | Net name |
Returns
Promise<IPCB_NetInfo | undefined>
Detailed information of the net, undefined is does not exist this net
Example
javascript
// 1. 创建带网络名的过孔,让 PCB 中出现可查询的网络
const via = await eda.pcb_PrimitiveVia.create('嘉立创示例_NET1', 2000, 2000, 20, 40);
// 2. 查询指定网络的详细信息
const netInfo = await eda.pcb_Net.getNet('嘉立创示例_NET1');
// 3. 清理测试图元(查询类需要清理)
await eda.pcb_PrimitiveVia.delete([via.getState_PrimitiveId()]);
console.log('netName:', netInfo?.net);
console.log('netColor:', netInfo?.color);
console.log('netLength:', netInfo?.length);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12