mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Revert "Add more parameters to material.add_layer"
This reverts commit 9946117de1.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user