IfcCorrectUnitAssignment
Definition from IAI: The function returns
true, if
the set of Units within an IfcUnitAssignment
only include units with different UnitType's (for IfcNamedUnit
and IfcDerivedUnit), and a maximum of one IfcMonetaryUnit.
Argument definitions:
Units : (input) the set of IfcUnit's.
EXPRESS specification:
|
|
(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 | ('IFCMEASURERESOURCE.IFCNAMEDUNIT' IN TYPEOF(temp)) AND NOT(temp.UnitType = IfcUnitEnum.USERDEFINED)));
DerivedUnitNumber := SIZEOF(QUERY(temp <* Units | ('IFCMEASURERESOURCE.IFCDERIVEDUNIT' IN TYPEOF(temp)) AND NOT(temp.UnitType = IfcDerivedUnitEnum.USERDEFINED)));
MonetaryUnitNumber := SIZEOF(QUERY(temp <* Units | 'IFCMEASURERESOURCE.IFCMONETARYUNIT' IN TYPEOF(temp)));
REPEAT i := 1 TO SIZEOF(Units);
IF (('IFCMEASURERESOURCE.IFCNAMEDUNIT' IN TYPEOF(Units[i])) AND NOT(Units[i].UnitType = IfcUnitEnum.USERDEFINED)) THEN
NamedUnitNames := NamedUnitNames + Units[i].UnitType;
END_IF;
IF (('IFCMEASURERESOURCE.IFCDERIVEDUNIT' IN TYPEOF(Units[i])) AND NOT(Units[i].UnitType = IfcDerivedUnitEnum.USERDEFINED)) THEN
DerivedUnitNames := DerivedUnitNames + Units[i].UnitType;
END_IF;
END_REPEAT;
RETURN((SIZEOF(NamedUnitNames) = NamedUnitNumber) AND (SIZEOF(DerivedUnitNames) = DerivedUnitNumber) AND (MonetaryUnitNumber <= 1));
|
|
|