Description
For reference and further communication: This issue was published on LinkedIn by Martin Krammer on Jan 7th 2023 at (https://www.linkedin.com/posts/martin-krammer_ifc-files-will-become-illegible-in-the-future-activity-7017530659803926528-WivK) after being made aware of the problem in a discussion about practical IFC with Rene Holzer.
THE BUG in short: It seems to be the case that many (arbitrary?) parameter/property units inRevit are not exported to IFC as a suitable unit from IfcMeasureResource, but the Units are just transformed into the IFC as plain IFCReal.
My test scenario: A wall in Revit 2023 with a few properties in a separate PropertySet with the latest IFC-Advanced Exporter IFC.for.Revit.2023.2.3.0.msi from Github https://lnkd.in/dtHgm8nN exported to IFC4 ReferenceViewV1.2
I provide my RVT23+IFC4 test files and some screenshots for verification here so that those responsible can take care of them as quickly as possible: Download https://lnkd.in/dTsAdtac
This affects the daily work of today's real BIM projects and future meaningful,
extensive, multi-level software links.
FINDINGS in detail:
THE POSITIVE FIRST: Custom project parameters defined in Revit such as "test_length" with unit [m1] are put correctly into IFC as IFCLENGHTHMEASURE.
Project parameters created from the official IFC Shared-Parameters-File (RevitIFCBuiltIn_ALL.txt) parameters like IfcGeneralMaterialProperties.MassDensity with unit [kg/m3] also deliver correctly as IFCMASSDENSITYMEASURE.
So it doesn't seem to make any difference whether it's "custom" or "shared" (or "official IFC-shared") parameters to let it sometimes work correctly (That is the reason why not many realize this in their daily work).
BUT: A custom velocity parameter "test_velocity" with the unit in Revit set to [km/h] is only written out as IFCREAL into the IFC, not witht he appropriate IFCLINEARVELOCITYMEASURE. Funnily in the IFC however, a fitting IFCUnit for that velocity as IFCDERIVEDUNIT((#41,#45),.LINEARVELOCITYUNIT.,$) is present within that IFC-File, but "unluckily" not referenced by this velocity-property. [m/s] (the programmer might have been too lazy to convert it here... but also switching velocities to [m/s] in the Revit project did not change the export output for velocities to come out other than IFCReal)
A velocity parameter from the IFC shared-parameter-file Pset_MarkerGeneral.ApproachSpeed is also wrongly written out to the IFC as IFCREAL too, not with IFCLINEARVELOCITYMEASURE. Here it is interesting, however, that in the IFC-shared-Parameter-File the unit is already correctly specified there as IfcLinearVelocityMeasure, but after the creation of the corresponding project parameter the unit in Revit only shows "Number" and not [m/s] or [km/h] as to would be expected... and it is therefore not surprising that this parameter is written out to IFC with IFCREAL if Revit itself only works with "Number" as the unit.
Now you might suspect that Revit just can't handle IFCDERIVEDUNITS "yet"... (but before making such easy finish speak, please also remember Revit is proudly certified for IFC4 import and export)
...BUT: A separate parameter "test_lambda" with unit "thermal conductivity" and [W/(mK)] goes correctly into the IFC with unit IFCTHERMALCONDUCTIVITYMEASURE.
Likewise as already mentioned, the IFC shared parameter IfcGeneralMaterialProperties.MassDensity is also correctly defined in the IFC shared-param-file with IfcMassDensityMeasure as well as later in Revit as a project parameter with the unit "mass density and [kg/m3] - correspondingly, the IFC export also leads to the correct IFCMASSDENSITYMEASURE.
CONCLUSION:
Obviously, Revit simply CAN'T really export SOME units of IFC "yet", no matter if coming from shared or custom revit parameters. In the exporter code you can see some methods that are supposed to handle this, e.g. IFCData CreateAsLinearVelocityMeasure(double), but they obviously don't work. For some other units, the methods are not there either, which is probably why it only works with IfcReal as a fallback (because IfcMolecularWeightMeasure, for example, does not work either and also has no special handling method, but it is also not available in the Revit unit GUI.
How many(?) other units don't work either... please sort this out. It's scary that such basic things do not work.