C_GetUnitsConversionFactor

C_GetUnitsConversionFactor calculates the scaling factor required to convert between a value in the model unit system and the SI unit system.

void C_GetUnitsConversionFactor(

TOrcFxAPIHandle ObjectHandle,

LPCTSTR lpUnits,

double *lpConversionFactor,

int *lpStatus

);

Parameters

ObjectHandle (IN)

The handle of an object. The conversion factor is calculated using the units of the model that owns this object.

lpUnits (IN)

A string which defines the units of the value to be converted. The string is made up of zero or more fundamental components, separated by "." or "/". The fundamental components are of the form "<base_unit>^N", where <base_unit> denotes the physical quantity, e.g. length, mass, etc., and $N$ is the exponent. If the exponent is omitted, then its value is taken to be 1.

The possible values for the base unit are:

The following examples demonstrate how to specify some commonly used units:

lpConversionFactor (OUT)

Points to a variable in which the conversion factor is returned. Multiply by this conversion factor to convert a value from SI units into model units. Divide by this conversion factor to convert a value from model units into SI units.

lpStatus (OUT)

Points to a variable in which the status result for the function call will be returned.

Unicode and ANSI

The Unicode function name is C_GetUnitsConversionFactorW and the ANSI function name is C_GetUnitsConversionFactorA.