UnitCollection Class

class NXOpen.UnitCollection

Bases: object

Provides methods for manipulating the units in a part

To obtain an instance of this class, refer to NXOpen.BasePart

New in version NX4.0.0.

Methods

Method Description
Convert Convert a value from one unit of measure to another @return
FindObject Finds the Unit with the given identifier as recorded in a journal.
GetBase Find the base part unit for a given type of measure @return base unit
GetMeasureTypes Finds the units that are available for a given type of measure @return Array of units for a given measurement type
GetMeasures Finds the list of different types of measures available in the system.

Method Detail

Convert

UnitCollection.Convert

Convert a value from one unit of measure to another

Signature Convert(initialUnit, targetUnit, initialValue)

Parameters:
  • initialUnit (NXOpen.Unit) – initial measurement unit
  • targetUnit (NXOpen.Unit) – target measurement unit
  • initialValue (float) –
Returns:

Return type:

float

New in version NX4.0.0.

License requirements: None.

FindObject

UnitCollection.FindObject

Finds the Unit with the given identifier as recorded in a journal. An exception will be thrown if no object can be found with the given journal identifier.

Signature FindObject(journalIdentifier)

Parameters:journalIdentifier (str) – Identifier to be found
Returns:Unit found
Return type:NXOpen.Unit

New in version NX4.0.0.

License requirements: None.

GetBase

UnitCollection.GetBase

Find the base part unit for a given type of measure

Signature GetBase(measureName)

Parameters:measureName (str) – the type of measure
Returns:base unit
Return type:NXOpen.Unit

New in version NX4.0.0.

License requirements: None.

GetMeasureTypes

UnitCollection.GetMeasureTypes

Finds the units that are available for a given type of measure

Signature GetMeasureTypes(measureName)

Parameters:measureName (str) – the type of measure
Returns:Array of units for a given measurement type
Return type:list of NXOpen.Unit

New in version NX4.0.0.

License requirements: None.

GetMeasures

UnitCollection.GetMeasures

Finds the list of different types of measures available in the system.

Types of measures include length, area and volume

Signature GetMeasures()

Returns:Array of names of measure types
Return type:list of str

New in version NX4.0.0.

License requirements: None.