mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
get_applicable_types in ifc2x3 to prioritize IfcBuildingElementProxyType
for occurrence classes without special type. E.g. previously: you select IfcSlab and change it to IfcRoof - since there is not IfcRoofType in IFC2X3 it would figure the matching product type is IfcBeamType and change this slab's type element to IfcBeamType. IfcBuildingElementProxyType seems more generic and fitting.
This commit is contained in:
@@ -183,6 +183,10 @@ class Usecase:
|
||||
if self.occurrence_class:
|
||||
ifc_class_ = self.occurrence_class
|
||||
else:
|
||||
# NOTE: in theory we can skip reassignment in IFC2X3 in some cases
|
||||
# e.g. if occurrence is IfcRoof and we're reassigning to IfcBuildingElementProxyType
|
||||
# but currently type_to_entity_map doesn't completely match entity_to_type_map,
|
||||
# see type.py for more details.
|
||||
ifc_class_ = next(iter(ifcopenshell.util.type.get_applicable_entities(ifc_class, self.file.schema)))
|
||||
self.reassign_class(occurrence, ifc_class_, predefined_type)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user