mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 03:19:53 +00:00
Replace all ifcopenshell.api.run with ifcopenshell.api static functions.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.cost
|
||||
import ifcopenshell.util.element
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ def remove_cost_schedule(file: ifcopenshell.file, cost_schedule: ifcopenshell.en
|
||||
|
||||
.. code:: python
|
||||
|
||||
schedule = ifcopenshell.api.run("cost.add_cost_schedule", model)
|
||||
item = ifcopenshell.api.run("cost.add_cost_item", model, cost_schedule=schedule)
|
||||
ifcopenshell.api.run("cost.remove_cost_schedule", model, cost_schedule=schedule)
|
||||
schedule = ifcopenshell.api.cost.add_cost_schedule(model)
|
||||
item = ifcopenshell.api.cost.add_cost_item(model, cost_schedule=schedule)
|
||||
ifcopenshell.api.cost.remove_cost_schedule(model, cost_schedule=schedule)
|
||||
"""
|
||||
settings = {"cost_schedule": cost_schedule}
|
||||
|
||||
@@ -46,7 +46,7 @@ def remove_cost_schedule(file: ifcopenshell.file, cost_schedule: ifcopenshell.en
|
||||
for inverse in file.get_inverse(settings["cost_schedule"]):
|
||||
if inverse.is_a("IfcRelAssignsToControl"):
|
||||
[
|
||||
ifcopenshell.api.run("cost.remove_cost_item", file, cost_item=related_object)
|
||||
ifcopenshell.api.cost.remove_cost_item(file, cost_item=related_object)
|
||||
for related_object in inverse.RelatedObjects
|
||||
if related_object.is_a("IfcCostItem")
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user