Home > SYS_Unit > getFrontendDataUnit
SYS_Unit.getFrontendDataUnit() 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 the EDA front-end data unit span
Signature
typescript
function getFrontendDataUnit(): Promise<ESYS_Unit | undefined>;1
Returns
Promise<ESYS_Unit | undefined>
Unit
Remarks
This refers to the units that front-end users can switch, and it needs to be compatible with both the schematic and PCB canvases
Example
javascript
// 1. 读取当前前端单位(返回 Promise,需要 await;结果为 ESYS_Unit 值,如 'mm'、'mil'、'in')
const unit = await eda.sys_Unit.getFrontendDataUnit();
// 2. 输出当前单位
console.log('前端当前单位:', unit);1
2
3
4
5
2
3
4
5