Navigation
Navigate Navigate Navigate Navigate

IfcDeriveDimensionalExponents

Definition from ISO/CD 10303-41:1992: The function determines the dimensional exponents of a unit. For named units the dimensions attribute is returned and for derived units the dimensional exponents are calculated from its elements.

Argument definitions:
X: (input) the unit that the dimensional exponents are being derived from.

EXPRESS specification:

FUNCTION IfcDeriveDimensionalExponents
(x : IfcUnit)           : IfcDimensionalExponents;  
  LOCAL
    Result : IfcDimensionalExponents :=
             IfcDimensionalExponents(0, 0, 0, 0, 0, 0, 0);  
  END_LOCAL;
  IF 'IFCMEASURERESOURCE.IFCDERIVEDUNIT' IN TYPEOF(x) THEN
    REPEAT i := LOINDEX(x.Elements) TO HIINDEX(x.Elements);
      Result.LengthExponent :=        Result.LengthExponent +
        (x.Elements[i].Exponent *
         x.Elements[i].Unit.Dimensions.LengthExponent);
      Result.MassExponent :=        Result.MassExponent  +
        (x.Elements[i].Exponent *
         x.Elements[i].Unit.Dimensions.MassExponent);
      Result.TimeExponent :=        Result.TimeExponent +
        (x.Elements[i].Exponent *
         x.Elements[i].Unit.Dimensions.TimeExponent);
      Result.ElectricCurrentExponent :=        Result.ElectricCurrentExponent +
        (x.Elements[i].Exponent *
         x.Elements[i].Unit.Dimensions.ElectricCurrentExponent);
      Result.ThermodynamicTemperatureExponent :=
        Result.ThermodynamicTemperatureExponent +
        (x.Elements[i].Exponent *
         x.Elements[i].Unit.Dimensions.ThermodynamicTemperatureExponent);
      Result.AmountOfSubstanceExponent :=
        Result.AmountOfSubstanceExponent +        (x.Elements[i].Exponent *
         x.Elements[i].Unit.Dimensions.AmountOfSubstanceExponent);
      Result.LuminousIntensityExponent :=
        Result.LuminousIntensityExponent +        (x.Elements[i].Exponent *
         x.Elements[i].Unit.Dimensions.LuminousIntensityExponent);
    END_REPEAT;  
  ELSE -- x is a unitless or a named unit
    Result := x.Dimensions;  
  END_IF;  
RETURN (Result);
END_FUNCTION;