mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
assign_representation - assign repr only to occurrence for profile- or layer-based types #6934
This commit is contained in:
@@ -41,6 +41,14 @@ class Usecase:
|
||||
product_type
|
||||
and product_type.RepresentationMaps
|
||||
and representation.RepresentationType != "MappedRepresentation"
|
||||
# Revit is adding a non-mapped representation to the exported profile-based types,
|
||||
# so assigning representation to occurrence by accident was assigning it to the type.
|
||||
# We guard from this by skipping profile and layer-based types.
|
||||
# See 6934 for example.
|
||||
and not (
|
||||
(material := ifcopenshell.util.element.get_material(product_type))
|
||||
and material.is_a() in ("IfcMaterialProfileSet", "IfcMaterialLayerSet")
|
||||
)
|
||||
):
|
||||
product = product_type
|
||||
|
||||
@@ -60,7 +68,7 @@ class Usecase:
|
||||
**{
|
||||
"MappingOrigin": self.file.createIfcAxis2Placement3D(self.zero, self.z_axis, self.x_axis),
|
||||
"MappedRepresentation": representation,
|
||||
}
|
||||
},
|
||||
)
|
||||
)
|
||||
product.RepresentationMaps = maps
|
||||
|
||||
Reference in New Issue
Block a user