NX Open C++ Reference Guide
Classes | Public Types | Public Member Functions | List of all members
NXOpen::UnitCollection Class Reference

Provides methods for manipulating the units in a part
To obtain an instance of this class, refer to NXOpen::BasePart

Created in NX4.0.0. More...

Inheritance diagram for NXOpen::UnitCollection:
NXOpen::TaggedObjectCollection

Classes

class  iterator
 Iterator for accessing the contents of the collection. More...
 

Public Types

enum  UnitDefaults {
  UnitDefaultsLbmInLbfDegF, UnitDefaultsLbmFtLbfDegF, UnitDefaultsGMmNDegC, UnitDefaultsGCmNDegC,
  UnitDefaultsKgMNRadK, UnitDefaultsKgMmNDegC
}
 Specifies a set of units to be used as defaults for data entry or object information For each measure, a unit type will be selected that matches the specified choice. More...
 

Public Member Functions

iterator begin ()
 Returns an iterator addressing the first element. More...
 
double Convert (NXOpen::Unit *initialUnitType, NXOpen::Unit *targetUnitType, double initialValue)
 Convert a value from one unit of measure to another. More...
 
iterator end ()
 Returns an iterator addressing one past the last element. More...
 
NXOpen::UnitFindObject (const NXString &name)
 Finds the Unit with the given name. More...
 
NXOpen::UnitFindObject (const char *name)
 Finds the Unit with the given name. More...
 
NXOpen::UnitGetBase (const NXString &measureName)
 Find the base unit type for a given measure. More...
 
NXOpen::UnitGetBase (const char *measureName)
 Find the base unit type for a given measure. More...
 
NXOpen::UnitCollection::UnitDefaults GetDefaultDataEntryUnits ()
 Get the choice of default set of units for data entry in the given part. More...
 
NXOpen::UnitCollection::UnitDefaults GetDefaultObjectInformationUnits ()
 Get the choice of default set of units for object information in the given part. More...
 
std::vector< NXStringGetMeasures ()
 Finds the list of different types of measures available in the system. More...
 
std::vector< NXOpen::Unit * > GetMeasureTypes (const NXString &measureName)
 Finds the unit types that are available for a given measure. More...
 
std::vector< NXOpen::Unit * > GetMeasureTypes (const char *measureName)
 Finds the unit types that are available for a given measure. More...
 
void SetDefaultDataEntryUnits (NXOpen::UnitCollection::UnitDefaults defaults)
 Set a choice of default set of units for data entry in the given part. More...
 
void SetDefaultObjectInformationUnits (NXOpen::UnitCollection::UnitDefaults defaults)
 Set a choice of default set of units for object information in the given part
Created in NX12.0.0. More...
 
tag_t Tag () const
 Returns the tag of this object. More...
 

Detailed Description

Provides methods for manipulating the units in a part
To obtain an instance of this class, refer to NXOpen::BasePart

Created in NX4.0.0.


Member Enumeration Documentation

Specifies a set of units to be used as defaults for data entry or object information For each measure, a unit type will be selected that matches the specified choice.

The choice affects these dimensions: Lenth Mass Force Angle Temperature Delta Temperature

These dimensions are not affected: Electric Charge (A-sec) Luminous Intensity (cd) Amount of Substance (mol)

NOTE: Only the SI unit set is an internally consistent set of units. For example, the unit for Force (N) is used in all the metric sets, but since it's defined as kg*m/s^2, it's compatible only with kg and m, which are used in the SI set. Similarly, the unit deg is used for all the sets except the SI set.

Enumerator
UnitDefaultsLbmInLbfDegF 

Usual choice for inch parts.

UnitDefaultsLbmFtLbfDegF 

Not supported for data entry units.

UnitDefaultsGMmNDegC 

Not supported for data entry units.

UnitDefaultsGCmNDegC 

Not supported for data entry units.

UnitDefaultsKgMNRadK 

SI compatibility.

UnitDefaultsKgMmNDegC 

Usual choice for mm parts.

Member Function Documentation

iterator NXOpen::UnitCollection::begin ( )

Returns an iterator addressing the first element.

double NXOpen::UnitCollection::Convert ( NXOpen::Unit initialUnitType,
NXOpen::Unit targetUnitType,
double  initialValue 
)

Convert a value from one unit of measure to another.

Returns

Created in NX4.0.0.

License requirements : None
Parameters
initialUnitTypeinitial measurement unit
targetUnitTypetarget measurement unit
initialValueinitial value
iterator NXOpen::UnitCollection::end ( )

Returns an iterator addressing one past the last element.

NXOpen::Unit* NXOpen::UnitCollection::FindObject ( const NXString name)

Finds the Unit with the given name.

Returns
Unit found
Created in NX4.0.0.

License requirements : None
Parameters
nameName to be found
NXOpen::Unit* NXOpen::UnitCollection::FindObject ( const char *  name)

Finds the Unit with the given name.

Returns
Unit found
Created in NX4.0.0.

License requirements : None
Parameters
nameName to be found
NXOpen::Unit* NXOpen::UnitCollection::GetBase ( const NXString measureName)

Find the base unit type for a given measure.

The returned unit type depends on whether the part is an inch or millimeter part.

Returns
base unit
Created in NX4.0.0.

License requirements : None
Parameters
measureNamethe type of measure
NXOpen::Unit* NXOpen::UnitCollection::GetBase ( const char *  measureName)

Find the base unit type for a given measure.

The returned unit type depends on whether the part is an inch or millimeter part.

Returns
base unit
Created in NX4.0.0.

License requirements : None
Parameters
measureNamethe type of measure
NXOpen::UnitCollection::UnitDefaults NXOpen::UnitCollection::GetDefaultDataEntryUnits ( )

Get the choice of default set of units for data entry in the given part.

Returns

Created in NX12.0.0.

License requirements : None
NXOpen::UnitCollection::UnitDefaults NXOpen::UnitCollection::GetDefaultObjectInformationUnits ( )

Get the choice of default set of units for object information in the given part.

Returns

Created in NX12.0.0.

License requirements : None
std::vector<NXString> NXOpen::UnitCollection::GetMeasures ( )

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


Types of measures include length, area and volume

Returns
Array of names of measures
Created in NX4.0.0.

License requirements : None
std::vector<NXOpen::Unit *> NXOpen::UnitCollection::GetMeasureTypes ( const NXString measureName)

Finds the unit types that are available for a given measure.

Returns
Array of units for a given measurement type
Created in NX4.0.0.

License requirements : None
Parameters
measureNamethe type of measure
std::vector<NXOpen::Unit *> NXOpen::UnitCollection::GetMeasureTypes ( const char *  measureName)

Finds the unit types that are available for a given measure.

Returns
Array of units for a given measurement type
Created in NX4.0.0.

License requirements : None
Parameters
measureNamethe type of measure
void NXOpen::UnitCollection::SetDefaultDataEntryUnits ( NXOpen::UnitCollection::UnitDefaults  defaults)

Set a choice of default set of units for data entry in the given part.


Created in NX12.0.0.

License requirements : None

Parameters
defaultsdefaults
void NXOpen::UnitCollection::SetDefaultObjectInformationUnits ( NXOpen::UnitCollection::UnitDefaults  defaults)

Set a choice of default set of units for object information in the given part
Created in NX12.0.0.



License requirements : None

Parameters
defaultsdefaults
tag_t NXOpen::UnitCollection::Tag ( ) const

Returns the tag of this object.


The documentation for this class was generated from the following file:
Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.