# OCC.UnitsAPI module

class `SwigPyIterator`(*args, **kwargs)

  Bases: `object`

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

    The membership flag

  `value`()

`register_handle`(handle, base_object)

  Inserts the handle into the base object to prevent memory corruption in certain cases

class `unitsapi`

  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`(*args)

    Return type: | Handle_Units_Dimensions

  static `DimensionElectricCurrent`(*args)

    Return type: | Handle_Units_Dimensions

  static `DimensionLength`(*args)

    Return type: | Handle_Units_Dimensions

  static `DimensionLess`(*args)

    Return type: | Handle_Units_Dimensions

  static `DimensionLuminousIntensity`(*args)

    Return type: | Handle_Units_Dimensions

  static `DimensionMass`(*args)

    Return type: | Handle_Units_Dimensions

  static `DimensionPlaneAngle`(*args)

    Return type: | Handle_Units_Dimensions

  static `DimensionSolidAngle`(*args)
    - Returns the basic dimensions.

    Return type: | Handle_Units_Dimensions

  static `DimensionThermodynamicTemperature`(*args)

    Return type: | Handle_Units_Dimensions

  static `DimensionTime`(*args)

    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`(*args)
    - Returns the current local system units.

    Return type: | UnitsAPI_SystemUnits

  static `Reload`(*args)

    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`(*args)
    - 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

  `thisown`

    The membership flag

`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

`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

`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

`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

`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

`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

`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

`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

`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

`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

`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

`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

`unitsapi_CurrentUnit`(*args)
  - Returns the current unit dimension <aUnit> from the unit quantity <aQuantity>.

  Parameters: | aQuantity (char *) –
  Return type: | char *

`unitsapi_DimensionAmountOfSubstance`(*args)

  Return type: | Handle_Units_Dimensions

`unitsapi_DimensionElectricCurrent`(*args)

  Return type: | Handle_Units_Dimensions

`unitsapi_DimensionLength`(*args)

  Return type: | Handle_Units_Dimensions

`unitsapi_DimensionLess`(*args)

  Return type: | Handle_Units_Dimensions

`unitsapi_DimensionLuminousIntensity`(*args)

  Return type: | Handle_Units_Dimensions

`unitsapi_DimensionMass`(*args)

  Return type: | Handle_Units_Dimensions

`unitsapi_DimensionPlaneAngle`(*args)

  Return type: | Handle_Units_Dimensions

`unitsapi_DimensionSolidAngle`(*args)
  - Returns the basic dimensions.

  Return type: | Handle_Units_Dimensions

`unitsapi_DimensionThermodynamicTemperature`(*args)

  Return type: | Handle_Units_Dimensions

`unitsapi_DimensionTime`(*args)

  Return type: | Handle_Units_Dimensions

`unitsapi_Dimensions`(*args)
  - return the dimension associated to the quantity

  Parameters: | aQuantity (char *) –
  Return type: | Handle_Units_Dimensions

`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

`unitsapi_LocalSystem`(*args)
  - Returns the current local system units.

  Return type: | UnitsAPI_SystemUnits

`unitsapi_Reload`(*args)

  Return type: | void

`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

`unitsapi_Save`(*args)
  - saves the units in the file .CurrentUnits of the directory pointed by the CSF_CurrentUnitsUserDefaults environment variable.

  Return type: | void

`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

`unitsapi_SetLocalSystem`(*args)
  - Sets the local system units. Example: SetLocalSystem(UnitsAPI_MDTV)

  Parameters: | aSystemUnit (UnitsAPI_SystemUnits) – default value is UnitsAPI_SI
  Return type: | void