Home > PCB_Layer > unlockLayer
PCB_Layer.unlockLayer() 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.
Unlock the layer
Signature
typescript
function unlockLayer(
layer?: TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable>,
): Promise<boolean>;1
2
3
2
3
Parameters
Parameter | Type | Description |
|---|---|---|
layer | TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable> | (Optional) Layer. If no layer is specified, all layers are used by default |
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 先锁定顶层(TOP=1)制造初始状态
await eda.pcb_Layer.lockLayer(1);
// 2. 解锁顶层,返回操作是否成功
const unlockResult = await eda.pcb_Layer.unlockLayer(1);
// 3. 从图层列表确认锁定已解除
const layers = await eda.pcb_Layer.getAllLayers();
const top = layers.find(l => l.id === 1);
console.log('unlockResult:', unlockResult);
console.log('topStillLocked:', top?.locked);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12