IFC4.3.x-development
IFC4.3.x-development copied to clipboard
Where to find the Datatype of PEnum_Xxx definitions?
Checking of IFC properties with IDS requires to specify the datatype. Where to find the underlying datatype of predefined IfcPropertyEnumeratedValues? This information is part of the IFC4 HTML documentation, but is not shown in IFC4.3 documentation anymore. Is there a general agreement that PEnum_Xxx definition are always of datatype IfcLabel?
This is a good question that hadn't crossed my mind earlier.
If I look at the IFC4 HTML I indeed see a datatype specification, e.g.
https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2/HTML/link/pset_manufactureroccurrence.htm
If I look at the .XML I don't see it though
https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2/HTML/link/pset_manufactureroccurrence.htm
So that could be a reason why it wasn't considered.
Therefore I had to get back to the definitions in IfcDoc to see whether the assumption to always assume IfcLabel is safe.
$ grep -R DocProperty . | grep p_enumeratedvalue | grep -Po 'PrimaryDataType="\w+"' | sort | uniq
PrimaryDataType="IfcLabel"
PrimaryDataType="PEnum_AirTerminalAirflowType"
Apparently once the PropertyType has been confused with the PrimaryDataType in IfcDoc, but other than that no other primary data type than IfcLabel was ever assigned in the spec.
So:
- bluntly make a note in IfcPropertyEnumeratedValues.md that indeed IfcLabel is always to be used as the property value data type. this is maybe not the most responsible and might violate existing MVDs, but since it does not seem to have been possible to distinguish this in PSD xmls I don't know to what extent that is a relevant concern
- adapt the HTML documentation of predefined penums to globally indicate IfcLabel there
- model the ability to indicate this in UML (not my favourite solution).
Thanks for bringing this up.
Thanks for fast feedback!
Ping @Andrej730 because for BBIM we typically use the IFC definitions not the XML and we noticed that the XML was missing data that the IFC contained. I vaguely recall this was one of them but after searching I only found #586.
Yeah, I think parsing psets .xmls I've just assumed all enum items are IfcLabels and never found an example where it wasn't
It's probably something to fix in the XML then, as I think for user defined pset templates (i.e. stored in IFC propertysettemplate entities) you can have non IfcLabel enums and I've seen users like @vulevukusej use it and I use it myself.
Indeed. the documentation also explicitly states this:
Primary measure type assigned to the definition of the property. It should be provided, if the TemplateType is set to: ... P_ENUMERATEDVALUE: determining the measure type of IfcPropertyEnumeratedValue.EnumerationValues ...
https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcSimplePropertyTemplate.htm
So the conclusions are:
- Non-label penums make sense. E.g my car either has a 58kWh or 77kWh battery pack
- In the specification non-label penums have never been used
- We should update the PSD XMLs
- I see that in the 4.3 pset template ifc we already default to IfcLabel, well done @Andrej730