mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
See #3184. Preserve parametric layerset axis direction hints when changing types.
This commit is contained in:
@@ -252,9 +252,17 @@ class DumbSlabPlaner:
|
|||||||
new_material = ifcopenshell.util.element.get_material(settings["relating_type"])
|
new_material = ifcopenshell.util.element.get_material(settings["relating_type"])
|
||||||
if not new_material or not new_material.is_a("IfcMaterialLayerSet"):
|
if not new_material or not new_material.is_a("IfcMaterialLayerSet"):
|
||||||
return
|
return
|
||||||
|
parametric = ifcopenshell.util.element.get_psets(settings["relating_type"]).get("EPset_Parametric")
|
||||||
|
layer_set_direction = None
|
||||||
|
if parametric:
|
||||||
|
layer_set_direction = parametric.get("LayerSetDirection", layer_set_direction)
|
||||||
new_thickness = sum([l.LayerThickness for l in new_material.MaterialLayers])
|
new_thickness = sum([l.LayerThickness for l in new_material.MaterialLayers])
|
||||||
material = ifcopenshell.util.element.get_material(settings["related_object"])
|
material = ifcopenshell.util.element.get_material(settings["related_object"])
|
||||||
if material and material.is_a("IfcMaterialLayerSetUsage") and material.LayerSetDirection == "AXIS3":
|
if not material or not material.is_a("IfcMaterialLayerSetUsage"):
|
||||||
|
return
|
||||||
|
if layer_set_direction:
|
||||||
|
material.LayerSetDirection = layer_set_direction
|
||||||
|
if material.LayerSetDirection == "AXIS3":
|
||||||
self.change_thickness(settings["related_object"], new_thickness)
|
self.change_thickness(settings["related_object"], new_thickness)
|
||||||
|
|
||||||
def change_thickness(self, element, thickness):
|
def change_thickness(self, element, thickness):
|
||||||
|
|||||||
@@ -699,8 +699,16 @@ class DumbWallPlaner:
|
|||||||
new_material = ifcopenshell.util.element.get_material(settings["relating_type"])
|
new_material = ifcopenshell.util.element.get_material(settings["relating_type"])
|
||||||
if not new_material or not new_material.is_a("IfcMaterialLayerSet"):
|
if not new_material or not new_material.is_a("IfcMaterialLayerSet"):
|
||||||
return
|
return
|
||||||
|
parametric = ifcopenshell.util.element.get_psets(settings["relating_type"]).get("EPset_Parametric")
|
||||||
|
layer_set_direction = None
|
||||||
|
if parametric:
|
||||||
|
layer_set_direction = parametric.get("LayerSetDirection", layer_set_direction)
|
||||||
material = ifcopenshell.util.element.get_material(settings["related_object"])
|
material = ifcopenshell.util.element.get_material(settings["related_object"])
|
||||||
if material and material.is_a("IfcMaterialLayerSetUsage") and material.LayerSetDirection == "AXIS2":
|
if not material or not material.is_a("IfcMaterialLayerSetUsage"):
|
||||||
|
return
|
||||||
|
if layer_set_direction:
|
||||||
|
material.LayerSetDirection = layer_set_direction
|
||||||
|
if material.LayerSetDirection == "AXIS2":
|
||||||
DumbWallRecalculator().recalculate([obj])
|
DumbWallRecalculator().recalculate([obj])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user