PCB_Drc.check() 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.
Check DRC
Signature
typescript
function check(
strict: boolean,
userInterface: boolean,
includeVerboseError: false,
): Promise<boolean>;1
2
3
4
5
2
3
4
5
Parameters
Parameter | Type | Description |
|---|---|---|
strict | boolean | Whether strict checking is enabled. The current PCB is uniformly in strict checking mode |
userInterface | boolean | Whether to show the UI (open the bottom DRC window) |
includeVerboseError | false | Whether to include detailed error information in the return value. If it is |
Returns
Promise<boolean>
Whether the DRC check passed
Example
javascript
// 1. 详细模式:返回全部违规项(含描述),无违规则为空数组
const details = await eda.pcb_Drc.check(true, false, true);
console.log('violationCount:', details.length);
details.forEach((d, i) => {
console.log(`[${i}]`, typeof d === 'string' ? d : JSON.stringify(d));
});
// 2. 布尔模式:只返回是否全部通过
const passed = await eda.pcb_Drc.check(true, false, false);
console.log('allPassed:', passed);1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10