Units in Opencacade5.2

how can we use unit classes in our application ?
When we import some file(say STEP) we have way to know the units from
file, but how can it be linked to UnitsAPI ?

When I set UnitsAPI::SetLocalSystem, UnitsAPI::CurrentUnit("LENGTH") gives me an error. But, if I use UnitsAPI::SetCurrentUnit("LENGTH","mm"); before
UnitsAPI::CurrentUnit("LENGTH"), it works fine.

UnitsAPI::SetLocalSystem(UnitsAPI_MDTV );
Standard_CString temp = UnitsAPI::CurrentUnit("LENGTH"); >>>>>mm

Isn't there any connection between Local system and individual property unit ?
I mean given UnitsAPI::SetLocalSystem (UnitsAPI_MDTV) should have given me correct answer.

Also, if I again change localsystem, this happens

Standard_CString temp = UnitsAPI::CurrentUnit("LENGTH"); >>>>> error>no resource "LENGTH"

Could any body tell me how it should be used ?


Michele Fiorentino's picture

hi , its old post maybe can help:
check your env variables : units api search for Lexi_Expr.dat