v2.45
 
IQuantity Interface Reference

Represents a quantity. More...

Public Member Functions

HRESULT AsAngle ([in] enum AngleUnit unit, [out, retval] double *pValue)
 Returns the quantity value as an angle measure.
 
HRESULT AsArea ([in] enum AreaUnit unit, [out, retval] double *pValue)
 Returns the quantity value as an area measure.
 
HRESULT AsCount ([out, retval] int *pValue)
 Returns the quantity value as a number.
 
HRESULT AsElevation ([in] enum LengthUnit unit, [out, retval] double *pValue)
 Returns the quantity value as an elevation measure. The value of the elevation measure can be either positive or negative.
 
HRESULT AsLength ([in] enum LengthUnit unit, [out, retval] double *pValue)
 Returns the quantity value as a length measure. The value of the length measure is always positive.
 
HRESULT AsMass ([in] enum MassUnit unit, [out, retval] double *pValue)
 Returns the quantity value as a mass measure.
 
HRESULT AsVolume ([in] enum VolumeUnit unit, [out, retval] double *pValue)
 Returns the quantity value as a volume measure.
 
HRESULT HasValue ([out, retval] VARIANT_BOOL *pResult)
 Indicates if the quantity has a value.
 

Properties

BSTR Name [get]
 The name of the quantity. Eequals to the quantity's GUID name.
 
BSTR Text [get]
 The localized text that describes the meaning of the quantity.
 
QuantityType Type [get]
 The type of the quantity.
 

Detailed Description

Represents a quantity.

Quantity contains the value of one of the following types: number, length, area, volume or mass. This interface can be obtained through IQuantityContainer.

Member Function Documentation

◆ AsAngle()

HRESULT AsAngle ( [in] enum AngleUnit unit,
[out, retval] double * pValue )

Returns the quantity value as an angle measure.

Parameters
[in]unitThe angle measurement unit.
[out]pValueThe quantity's value in specified units.

◆ AsArea()

HRESULT AsArea ( [in] enum AreaUnit unit,
[out, retval] double * pValue )

Returns the quantity value as an area measure.

Parameters
[in]unitThe area measurement unit.
[out]pValueThe quantity's value in specified units.

◆ AsCount()

HRESULT AsCount ( [out, retval] int * pValue)

Returns the quantity value as a number.

Parameters
[out]pValueThe quantity's value.

◆ AsElevation()

HRESULT AsElevation ( [in] enum LengthUnit unit,
[out, retval] double * pValue )

Returns the quantity value as an elevation measure. The value of the elevation measure can be either positive or negative.

For a quantity of type QuantityType_Elevation, you can also get the value as a length measure using the AsLength method.

Parameters
[in]unitThe length measurement unit.
[out]pValueThe quantity's value in specified units.
See also
AsLength

◆ AsLength()

HRESULT AsLength ( [in] enum LengthUnit unit,
[out, retval] double * pValue )

Returns the quantity value as a length measure. The value of the length measure is always positive.

Parameters
[in]unitThe length measurement unit.
[out]pValueThe quantity's value in specified units.

◆ AsMass()

HRESULT AsMass ( [in] enum MassUnit unit,
[out, retval] double * pValue )

Returns the quantity value as a mass measure.

Parameters
[in]unitThe mass measurement unit.
[out]pValueThe quantity's value in specified units.

◆ AsVolume()

HRESULT AsVolume ( [in] enum VolumeUnit unit,
[out, retval] double * pValue )

Returns the quantity value as a volume measure.

Parameters
[in]unitThe volume measurement unit.
[out]pValueThe quantity's value in specified units.

◆ HasValue()

HRESULT HasValue ( [out, retval] VARIANT_BOOL * pResult)

Indicates if the quantity has a value.

Returns
TRUE if the quantity has a value; otherwise returns FALSE.

Property Documentation

◆ Name

BSTR Name
get

The name of the quantity. Eequals to the quantity's GUID name.

Use IQuantity::Text to get description.

Returns
The name of the quantity.

◆ Text

BSTR Text
get

The localized text that describes the meaning of the quantity.

Returns
The text of the quantity.