Home > PCB_Drc > setAsDefaultRuleConfiguration
PCB_Drc.setAsDefaultRuleConfiguration() 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.
Set as the default design rule configuration for new PCBs
Signature
typescript
function setAsDefaultRuleConfiguration(configurationName: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
configurationName | string | Configuration name |
Returns
Promise<boolean>
Set Whether Successful
Remarks
The return value is result-oriented. Repeatedly setting the same design rule as the default will also return true
Example
javascript
// 1. 读取当前配置并保存为自定义配置(作为待指定的默认配置)
const current = await eda.pcb_Drc.getCurrentRuleConfiguration();
await eda.pcb_Drc.saveRuleConfiguration(current.config, '嘉立创示例_默认规则配置', true);
// 2. 把它设置为新建 PCB 的默认设计规则配置
const result = await eda.pcb_Drc.setAsDefaultRuleConfiguration('嘉立创示例_默认规则配置');
console.log('result:', result);1
2
3
4
5
6
7
8
2
3
4
5
6
7
8