mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Replace all ifcopenshell.api.run with ifcopenshell.api static functions.
This commit is contained in:
@@ -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 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user