OCC.UnitsAPI module

class OCC.UnitsAPI.SwigPyIterator(*args, **kwargs)

Bases: object

advance()
copy()
decr()
distance()
equal()
incr()
next()
previous()
thisown

The membership flag

value()
class OCC.UnitsAPI.unitsapi(*args, **kwargs)

Bases: object

static AnyFromLS(*args)
  • Converts the local system units value to the local unit value. Example: AnyFromLS(25.4,’in.’) returns 1. if the LocalSystem is MDTV. Note: aUnit is also used to identify the type of physical quantity to convert.
Parameters:
  • aData (float) –
  • aUnit (char *) –
Return type:

float

static AnyFromSI(*args)
  • Converts the SI system units value to the local unit value. Example: AnyFromSI(0.0254,’in.’) returns 0.001 Note: aUnit is also used to identify the type of physical quantity to convert.
Parameters:
  • aData (float) –
  • aUnit (char *) –
Return type:

float

static AnyToAny(*args)
  • Converts the local unit value to another local unit value. Example: AnyToAny(0.0254,’in.’,’millimeter’) returns 1. ;
Parameters:
  • aData (float) –
  • aUnit1 (char *) –
  • aUnit2 (char *) –
Return type:

float

static AnyToLS(*args)
  • Converts the local unit value to the local system units value. Example: AnyToLS(1.,’in.’) returns 25.4 if the LocalSystem is MDTV.
Parameters:
  • aData (float) –
  • aUnit (char *) –
Return type:

float

  • Converts the local unit value to the local system units value. and gives the associated dimension of the unit
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

static AnyToSI(*args)
  • Converts the local unit value to the SI system units value. Example: AnyToSI(1.,’in.’) returns 0.0254
Parameters:
  • aData (float) –
  • aUnit (char *) –
Return type:

float

  • Converts the local unit value to the SI system units value. and gives the associated dimension of the unit
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

static Check(*args)
  • Checks the coherence between the quantity <aQuantity> and the unit <aUnits> in the current system and //! returns False when it’s WRONG.
Parameters:
  • aQuantity (char *) –
  • aUnit (char *) –
Return type:

bool

static CurrentFromAny(*args)
  • Converts the aData value expressed in the unit aUnit, into the current unit for the working environment, as defined for the physical quantity aQuantity by the last call to the SetCurrentUnit function.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
  • aUnit (char *) –
Return type:

float

static CurrentFromLS(*args)
  • Converts the local system units value to the current unit value. Example: CurrentFromLS(1000.,’LENGTH’) returns 1. if current length unit is meter and LocalSystem is MDTV.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

static CurrentFromSI(*args)
  • Converts the SI system units value to the current unit value. Example: CurrentFromSI(0.001,’LENGTH’) returns 1 if current length unit is millimeter.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

static CurrentToAny(*args)
  • Converts the aData value expressed in the current unit for the working environment, as defined for the physical quantity aQuantity by the last call to the SetCurrentUnit function, into the unit aUnit.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
  • aUnit (char *) –
Return type:

float

static CurrentToLS(*args)
  • Converts the current unit value to the local system units value. Example: CurrentToLS(1.,’LENGTH’) returns 1000. if the current length unit is meter and LocalSystem is MDTV.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

static CurrentToSI(*args)
  • Converts the current unit value to the SI system units value. Example: CurrentToSI(1.,’LENGTH’) returns 0.001 if current length unit is millimeter.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

static CurrentUnit(*args)
  • Returns the current unit dimension <aUnit> from the unit quantity <aQuantity>.
Parameters:aQuantity (char *) –
Return type:char *
static DimensionAmountOfSubstance()
Return type:Handle_Units_Dimensions
static DimensionElectricCurrent()
Return type:Handle_Units_Dimensions
static DimensionLength()
Return type:Handle_Units_Dimensions
static DimensionLess()
Return type:Handle_Units_Dimensions
static DimensionLuminousIntensity()
Return type:Handle_Units_Dimensions
static DimensionMass()
Return type:Handle_Units_Dimensions
static DimensionPlaneAngle()
Return type:Handle_Units_Dimensions
static DimensionSolidAngle()
  • Returns the basic dimensions.
Return type:Handle_Units_Dimensions
static DimensionThermodynamicTemperature()
Return type:Handle_Units_Dimensions
static DimensionTime()
Return type:Handle_Units_Dimensions
static Dimensions(*args)
  • return the dimension associated to the quantity
Parameters:aQuantity (char *) –
Return type:Handle_Units_Dimensions
static LSToSI(*args)
  • Converts the local system units value to the SI system unit value. Example: LSToSI(1.,’LENGTH’) returns 0.001 if the local system //! length unit is millimeter.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

static LocalSystem()
  • Returns the current local system units.
Return type:UnitsAPI_SystemUnits
static Reload()
Return type:void
static SIToLS(*args)
  • Converts the SI system unit value to the local system units value. Example: SIToLS(1.,’LENGTH’) returns 1000. if the local system //! length unit is millimeter.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

static Save()
  • saves the units in the file .CurrentUnits of the directory pointed by the CSF_CurrentUnitsUserDefaults environment variable.
Return type:void
static SetCurrentUnit(*args)
  • Sets the current unit dimension <aUnit> to the unit quantity <aQuantity>. Example: SetCurrentUnit(‘LENGTH’,’millimeter’)
Parameters:
  • aQuantity (char *) –
  • aUnit (char *) –
Return type:

void

static SetLocalSystem(*args)
  • Sets the local system units. Example: SetLocalSystem(UnitsAPI_MDTV)
Parameters:aSystemUnit (UnitsAPI_SystemUnits) – default value is UnitsAPI_SI
Return type:void
  • Sets the local system units. Example: SetLocalSystem(UnitsAPI_MDTV)
Parameters:aSystemUnit (UnitsAPI_SystemUnits) – default value is UnitsAPI_SI
Return type:void
thisown

The membership flag

OCC.UnitsAPI.unitsapi_AnyFromLS(*args)
  • Converts the local system units value to the local unit value. Example: AnyFromLS(25.4,’in.’) returns 1. if the LocalSystem is MDTV. Note: aUnit is also used to identify the type of physical quantity to convert.
Parameters:
  • aData (float) –
  • aUnit (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_AnyFromSI(*args)
  • Converts the SI system units value to the local unit value. Example: AnyFromSI(0.0254,’in.’) returns 0.001 Note: aUnit is also used to identify the type of physical quantity to convert.
Parameters:
  • aData (float) –
  • aUnit (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_AnyToAny(*args)
  • Converts the local unit value to another local unit value. Example: AnyToAny(0.0254,’in.’,’millimeter’) returns 1. ;
Parameters:
  • aData (float) –
  • aUnit1 (char *) –
  • aUnit2 (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_AnyToLS(*args)
  • Converts the local unit value to the local system units value. Example: AnyToLS(1.,’in.’) returns 25.4 if the LocalSystem is MDTV.
Parameters:
  • aData (float) –
  • aUnit (char *) –
Return type:

float

  • Converts the local unit value to the local system units value. and gives the associated dimension of the unit
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

OCC.UnitsAPI.unitsapi_AnyToSI(*args)
  • Converts the local unit value to the SI system units value. Example: AnyToSI(1.,’in.’) returns 0.0254
Parameters:
  • aData (float) –
  • aUnit (char *) –
Return type:

float

  • Converts the local unit value to the SI system units value. and gives the associated dimension of the unit
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

OCC.UnitsAPI.unitsapi_Check(*args)
  • Checks the coherence between the quantity <aQuantity> and the unit <aUnits> in the current system and //! returns False when it’s WRONG.
Parameters:
  • aQuantity (char *) –
  • aUnit (char *) –
Return type:

bool

OCC.UnitsAPI.unitsapi_CurrentFromAny(*args)
  • Converts the aData value expressed in the unit aUnit, into the current unit for the working environment, as defined for the physical quantity aQuantity by the last call to the SetCurrentUnit function.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
  • aUnit (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_CurrentFromLS(*args)
  • Converts the local system units value to the current unit value. Example: CurrentFromLS(1000.,’LENGTH’) returns 1. if current length unit is meter and LocalSystem is MDTV.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_CurrentFromSI(*args)
  • Converts the SI system units value to the current unit value. Example: CurrentFromSI(0.001,’LENGTH’) returns 1 if current length unit is millimeter.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_CurrentToAny(*args)
  • Converts the aData value expressed in the current unit for the working environment, as defined for the physical quantity aQuantity by the last call to the SetCurrentUnit function, into the unit aUnit.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
  • aUnit (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_CurrentToLS(*args)
  • Converts the current unit value to the local system units value. Example: CurrentToLS(1.,’LENGTH’) returns 1000. if the current length unit is meter and LocalSystem is MDTV.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_CurrentToSI(*args)
  • Converts the current unit value to the SI system units value. Example: CurrentToSI(1.,’LENGTH’) returns 0.001 if current length unit is millimeter.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_CurrentUnit(*args)
  • Returns the current unit dimension <aUnit> from the unit quantity <aQuantity>.
Parameters:aQuantity (char *) –
Return type:char *
OCC.UnitsAPI.unitsapi_DimensionAmountOfSubstance()
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_DimensionElectricCurrent()
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_DimensionLength()
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_DimensionLess()
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_DimensionLuminousIntensity()
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_DimensionMass()
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_DimensionPlaneAngle()
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_DimensionSolidAngle()
  • Returns the basic dimensions.
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_DimensionThermodynamicTemperature()
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_DimensionTime()
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_Dimensions(*args)
  • return the dimension associated to the quantity
Parameters:aQuantity (char *) –
Return type:Handle_Units_Dimensions
OCC.UnitsAPI.unitsapi_LSToSI(*args)
  • Converts the local system units value to the SI system unit value. Example: LSToSI(1.,’LENGTH’) returns 0.001 if the local system //! length unit is millimeter.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_LocalSystem()
  • Returns the current local system units.
Return type:UnitsAPI_SystemUnits
OCC.UnitsAPI.unitsapi_Reload()
Return type:void
OCC.UnitsAPI.unitsapi_SIToLS(*args)
  • Converts the SI system unit value to the local system units value. Example: SIToLS(1.,’LENGTH’) returns 1000. if the local system //! length unit is millimeter.
Parameters:
  • aData (float) –
  • aQuantity (char *) –
Return type:

float

OCC.UnitsAPI.unitsapi_Save()
  • saves the units in the file .CurrentUnits of the directory pointed by the CSF_CurrentUnitsUserDefaults environment variable.
Return type:void
OCC.UnitsAPI.unitsapi_SetCurrentUnit(*args)
  • Sets the current unit dimension <aUnit> to the unit quantity <aQuantity>. Example: SetCurrentUnit(‘LENGTH’,’millimeter’)
Parameters:
  • aQuantity (char *) –
  • aUnit (char *) –
Return type:

void

OCC.UnitsAPI.unitsapi_SetLocalSystem(*args)
  • Sets the local system units. Example: SetLocalSystem(UnitsAPI_MDTV)
Parameters:aSystemUnit (UnitsAPI_SystemUnits) – default value is UnitsAPI_SI
Return type:void
  • Sets the local system units. Example: SetLocalSystem(UnitsAPI_MDTV)
Parameters:aSystemUnit (UnitsAPI_SystemUnits) – default value is UnitsAPI_SI
Return type:void