From 91f4687eace4da0ccc2fe67ebd0f2f2dba7b27f0 Mon Sep 17 00:00:00 2001 From: Carlos Villagrasa Date: Fri, 17 Mar 2023 17:02:35 +0100 Subject: [PATCH] Revert "Add more parameters to material.add_layer" This reverts commit 9946117de18aae1ff5ea110eeb4c7d6395eba0e6. --- .../ifcopenshell/api/material/add_layer.py | 37 +++---------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/material/add_layer.py b/src/ifcopenshell-python/ifcopenshell/api/material/add_layer.py index 380932b67a..89c3e6b2a1 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/material/add_layer.py +++ b/src/ifcopenshell-python/ifcopenshell/api/material/add_layer.py @@ -18,8 +18,7 @@ class Usecase: - def __init__(self, file, layer_set=None, material=None, thickness=1., ventilated=None, name=None, description=None, - category=None, priority=None): + def __init__(self, file, layer_set=None, material=None): """Adds a new layer to a layer set A layer represents a portion of material within a layered build up, @@ -40,20 +39,6 @@ class Usecase: :type layer_set: ifcopenshell.entity_instance.entity_instance :param material: The IfcMaterial that the layer is made out of. :type material: ifcopenshell.entity_instance.entity_instance - :param thickness: The thickness of the material layer. - :type thickness: float - :param ventilated: Indication of whether the material layer represents an air layer (or cavity). - :type ventilated: bool - :param name: The name by which the material layer is known. - :type name: str - :param description: Definition of the material layer in more descriptive terms than given by attributes Name or Category. - :type description: str - :param category: Category of the material layer, e.g. the role it has in the layer set it belongs to - (such as 'load bearing', 'thermal insulation' etc.). - :type category: str - :param priority: The relative priority of the layer, expressed as normalised integer range [0..100]. - Controls how layers intersect in connections and corners of building elements. - :type priority: int :return: The newly created IfcMaterialLayer :rtype: ifcopenshell.entity_instance.entity_instance @@ -94,25 +79,13 @@ class Usecase: ifcopenshell.api.run("material.assign_material", model, product=wall_type, material=material_set) """ self.file = file - self.settings = { - "layer_set": layer_set, "material": material, "thickness": thickness, "ventilated": ventilated, - "name": name, "description": description, "category": category, "priority": priority - } + self.settings = {"layer_set": layer_set, "material": material} def execute(self): layers = list(self.settings["layer_set"].MaterialLayers or []) - args = {"Material": self.settings["material"], "LayerThickness": self.settings["thickness"]} - if self.settings["ventilated"]: - args["IsVentilated"] = self.settings["ventilated"] - if self.settings["name"]: - args["Name"] = self.settings["name"] - if self.settings["description"]: - args["Description"] = self.settings["description"] - if self.settings["category"]: - args["Category"] = self.settings["category"] - if self.settings["priority"]: - args["Priority"] = self.settings["priority"] - layer = self.file.create_entity("IfcMaterialLayer", **args) + layer = self.file.create_entity( + "IfcMaterialLayer", **{"Material": self.settings["material"], "LayerThickness": 1.0} + ) layers.append(layer) self.settings["layer_set"].MaterialLayers = layers return layer