Home > PCB_Document > autoRouting
PCB_Document.autoRouting() 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.
Auto routing
Signature
typescript
function autoRouting(props?: IPCB_AutoRoutingProps): Promise<IPCB_AutoRoutingResult>;1
Parameters
Parameter | Type | Description |
|---|---|---|
props | (Optional) Auto routing parameter |
Returns
Promise<IPCB_AutoRoutingResult>
Auto routing result
Remarks
ADD since EDA v3.2.150 If no parameters are passed in, auto routing will be performed for all unrouted nets
本接口预期将会执行较长时间,可以尝试异步处理或增加超时时限
注意事项: - 本接口内部存在固定的 900 秒(15 分钟)硬上限,CLI 的 --timeout 参数无法覆盖该上限; - 超时或失败后,中间几何结果不会提交(超时后调用 save() 图元可能仍为 0/0),如需保留中间结果请改用 作业模型; - props.layers 必须传入**启用层**(layerStatus !== NOT_USED),传停用层会被静默忽略
/ EDA v4.1.66
Example
javascript
// 对所有未布线的网络进行自动布线
const result = await eda.pcb_Document.autoRouting();
console.log(`布线完成:${result.routedNets}/${result.totalNets}`);
// 指定网络进行自动布线,并忽略部分网络
const result = await eda.pcb_Document.autoRouting({
nets: ['VCC', 'GND', 'SDA', 'SCL'],
ignoreNets: ['NC'],
cornerStyle: EPCB_AutoRoutingCornerStyle.DEGREE_45,
optimization: EPCB_AutoRoutingOptimization.COMPLETION,
});1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11