Replace all ifcopenshell.api.run with ifcopenshell.api static functions.

This commit is contained in:
Dion Moult
2024-06-28 12:36:31 +10:00
parent b5d613989e
commit 07060fc769
432 changed files with 4633 additions and 4856 deletions
@@ -68,15 +68,15 @@ def add_material(
.. code:: python
# Let's create two materials with their respective categories
concrete = ifcopenshell.api.run("material.add_material", model, name="CON01", category="concrete", description="Garage Slab")
steel = ifcopenshell.api.run("material.add_material", model, name="ST01", category="steel", description="Corten Steel")
concrete = ifcopenshell.api.material.add_material(model, name="CON01", category="concrete", description="Garage Slab")
steel = ifcopenshell.api.material.add_material(model, name="ST01", category="steel", description="Corten Steel")
# Let's imagine an urban concrete bench which is purely made out of concrete
concrete_bench = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcFurnitureType")
concrete_bench = ifcopenshell.api.root.create_entity(model, ifc_class="IfcFurnitureType")
# Assign the concrete material to that bench. Note that no colour
# "Style" has been specified.
ifcopenshell.api.run("material.assign_material", model, products=[concrete_bench], material=concrete)
ifcopenshell.api.material.assign_material(model, products=[concrete_bench], material=concrete)
"""
settings = {"name": name or "Unnamed", "category": category, "description": description }