mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
Fix #7166. Don't create glazing constituent for doors without transoms. Clarify framing name.
This commit is contained in:
@@ -95,15 +95,17 @@ def update_door_modifier_representation(obj: bpy.types.Object) -> None:
|
|||||||
representation_data["part_of_product"] = None
|
representation_data["part_of_product"] = None
|
||||||
tool.Model.replace_object_ifc_representation(body, obj, model_representation)
|
tool.Model.replace_object_ifc_representation(body, obj, model_representation)
|
||||||
if fallback_material := (int(props.lining_material) or int(props.framing_material) or int(props.glazing_material)):
|
if fallback_material := (int(props.lining_material) or int(props.framing_material) or int(props.glazing_material)):
|
||||||
|
materials = {
|
||||||
|
"Lining": tool.Ifc.get().by_id(int(props.lining_material) or fallback_material),
|
||||||
|
"Framing": tool.Ifc.get().by_id(int(props.framing_material) or fallback_material),
|
||||||
|
}
|
||||||
|
if props.transom_thickness:
|
||||||
|
materials["Glazing"] = tool.Ifc.get().by_id(int(props.glazing_material) or fallback_material)
|
||||||
ifcopenshell.api.material.set_shape_aspect_constituents(
|
ifcopenshell.api.material.set_shape_aspect_constituents(
|
||||||
ifc_file,
|
ifc_file,
|
||||||
element=element,
|
element=element,
|
||||||
context=body,
|
context=body,
|
||||||
materials={
|
materials=materials,
|
||||||
"Lining": tool.Ifc.get().by_id(int(props.lining_material) or fallback_material),
|
|
||||||
"Framing": tool.Ifc.get().by_id(int(props.framing_material) or fallback_material),
|
|
||||||
"Glazing": tool.Ifc.get().by_id(int(props.glazing_material) or fallback_material),
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
elif material := ifcopenshell.util.element.get_material(element):
|
elif material := ifcopenshell.util.element.get_material(element):
|
||||||
ifcopenshell.api.material.unassign_material(ifc_file, products=[element])
|
ifcopenshell.api.material.unassign_material(ifc_file, products=[element])
|
||||||
|
|||||||
@@ -550,7 +550,7 @@ class BIM_PT_door(bpy.types.Panel):
|
|||||||
|
|
||||||
row = prop_with_search(self.layout, props, "lining_material")
|
row = prop_with_search(self.layout, props, "lining_material")
|
||||||
tool.Model.draw_material_ui_select(row, props.lining_material)
|
tool.Model.draw_material_ui_select(row, props.lining_material)
|
||||||
row = prop_with_search(self.layout, props, "framing_material", text="Panel Material")
|
row = prop_with_search(self.layout, props, "framing_material", text="Panel Framing Material")
|
||||||
tool.Model.draw_material_ui_select(row, props.framing_material)
|
tool.Model.draw_material_ui_select(row, props.framing_material)
|
||||||
if props.transom_thickness:
|
if props.transom_thickness:
|
||||||
row = prop_with_search(self.layout, props, "glazing_material")
|
row = prop_with_search(self.layout, props, "glazing_material")
|
||||||
|
|||||||
Reference in New Issue
Block a user