FUNCTION IfcCorrectUnitAssignment

(* SCHEMA IFC4; *)
FUNCTION IfcCorrectUnitAssignment
  (Units : SET [1:?] OF IfcUnit)
   : LOGICAL;

  LOCAL
    NamedUnitNumber    : INTEGER := 0;
    DerivedUnitNumber  : INTEGER := 0;
    MonetaryUnitNumber : INTEGER := 0;
    NamedUnitNames     : SET OF IfcUnitEnum := [];
    DerivedUnitNames   : SET OF IfcDerivedUnitEnum := [];
  END_LOCAL;

  NamedUnitNumber    := SIZEOF(QUERY(temp <* Units | ('IFC4.IFCNAMEDUNIT' IN TYPEOF(temp)) AND NOT(temp\IfcNamedUnit.UnitType = IfcUnitEnum.USERDEFINED)));
  DerivedUnitNumber  := SIZEOF(QUERY(temp <* Units | ('IFC4.IFCDERIVEDUNIT' IN TYPEOF(temp)) AND NOT(temp\IfcDerivedUnit.UnitType = IfcDerivedUnitEnum.USERDEFINED)));
  MonetaryUnitNumber := SIZEOF(QUERY(temp <* Units |  'IFC4.IFCMONETARYUNIT' IN TYPEOF(temp)));

  REPEAT i := 1 TO SIZEOF(Units);
    IF (('IFC4.IFCNAMEDUNIT' IN TYPEOF(Units[i])) AND NOT(Units[i]\IfcNamedUnit.UnitType = IfcUnitEnum.USERDEFINED)) THEN
        NamedUnitNames := NamedUnitNames + Units[i]\IfcNamedUnit.UnitType;
    END_IF;
    IF (('IFC4.IFCDERIVEDUNIT' IN TYPEOF(Units[i])) AND NOT(Units[i]\IfcDerivedUnit.UnitType = IfcDerivedUnitEnum.USERDEFINED)) THEN
        DerivedUnitNames := DerivedUnitNames + Units[i]\IfcDerivedUnit.UnitType;
    END_IF;
  END_REPEAT;

  RETURN((SIZEOF(NamedUnitNames) = NamedUnitNumber) AND (SIZEOF(DerivedUnitNames) = DerivedUnitNumber) AND (MonetaryUnitNumber <= 1));

END_FUNCTION;

Referenced By

Defintion IfcCorrectUnitAssignment is references by the following definitions:
DefinitionType
 IfcUnitAssignment ENTITY


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2024-07-11T21:39:05-04:00