This means you can't access the value from an ancestor class without casting to the concrete class.
This is problematic when building queries against super-classes of a collection of objects. e.g. filtering by IfcWall.IsTypedBy.RelatingType provides an ITypeObject, which you would expect to be an IfcWallType - but in many other cases the isTypedBy relationship is much more open.
A particular use case has come up in the xbim implementation of BuildingSMART IDS, where you may have a specification that wants to select all IfcFlowTerminals elements defined by a Type with a PredefinedTypeBATH or another enum from IfcSanitaryTerminalTypeEnum.
Xbim Essentials implements PredefinedType as a strongly typed enumeration on concrete schema classes. E.g. IfcSanitaryTerminalType.PredefinedType
This means you can't access the value from an ancestor class without casting to the concrete class.
This is problematic when building queries against super-classes of a collection of objects. e.g. filtering by
IfcWall.IsTypedBy.RelatingType
provides an ITypeObject, which you would expect to be an IfcWallType - but in many other cases the isTypedBy relationship is much more open.A particular use case has come up in the xbim implementation of BuildingSMART IDS, where you may have a specification that wants to select all IfcFlowTerminals elements defined by a Type with a PredefinedType BATH or another enum from IfcSanitaryTerminalTypeEnum.
See https://github.com/buildingSMART/IDS/pull/240#pullrequestreview-1864768625 for more details. The set of possible types for IfcFlowTerminal.IsTypedBy is unconstrained. The existing solution to this would likely involve one of:
Another general solution in Essentials would be to provide support for accessing a string (or object) value from a base class in xbim such as:
This could be implemented either in code-gen, partial classes, or generically using the ExpressMetadata and reflection
This would also need to be on IIfcTypeObject etc.