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
@@ -51,18 +51,18 @@ def add_resource_quantity(
.. code:: python
# Add our own crew
crew = ifcopenshell.api.run("resource.add_resource", model, ifc_class="IfcCrewResource")
crew = ifcopenshell.api.resource.add_resource(model, ifc_class="IfcCrewResource")
# Add some labour to our crew.
labour = ifcopenshell.api.run("resource.add_resource", model,
labour = ifcopenshell.api.resource.add_resource(model,
parent_resource=crew, ifc_class="IfcLaborResource")
# Labour resource is quantified in terms of time.
quantity = ifcopenshell.api.run("resource.add_resource_quantity", model,
quantity = ifcopenshell.api.resource.add_resource_quantity(model,
resource=labour, ifc_class="IfcQuantityTime")
# Store the time used in hours
ifcopenshell.api.run("resource.edit_resource_quantity", model,
ifcopenshell.api.resource.edit_resource_quantity(model,
physical_quantity=quantity, attributes={"TimeValue": 8.0})
"""
settings = {"resource": resource, "ifc_class": ifc_class}