Home > IPCB_PrimitiveDimension > getState_Unit
IPCB_PrimitiveDimension.getState_Unit() method
Get the property state: unit
Signature
typescript
function getState_Unit():
ESYS_Unit.MILLIMETER | ESYS_Unit.CENTIMETER | ESYS_Unit.INCH | ESYS_Unit.MIL;1
2
2
Returns
ESYS_Unit.MILLIMETER | ESYS_Unit.CENTIMETER | ESYS_Unit.INCH | ESYS_Unit.MIL
Unit
Example
javascript
// 1. 创建一个默认单位(毫米)的长度标注
const dim = await eda.pcb_PrimitiveDimension.create(
'Length Dimension',
[1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
3
);
// 2. 读取显示单位('mm' / 'cm' / 'inch' / 'mil')
const unit = dim.getState_Unit();
// 3. 清理测试图元(查询类案例不留测试对象)
await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
console.log('unit:', unit);1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14