mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
Add documentation for cost module
This commit is contained in:
@@ -18,11 +18,32 @@
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
def __init__(self, file, cost_item=None, physical_quantity=None):
|
||||
"""Removes a quantity assigned to a cost item
|
||||
|
||||
If the quantity is part of a product (e.g. wall), then the quantity will
|
||||
still exist and merely the relationship to the cost item will be
|
||||
removed.
|
||||
|
||||
:param cost_item: The IfcCostItem that the quantity is assigned to
|
||||
:type cost_item: ifcopenshell.entity_instance.entity_instance
|
||||
:param physical_quantity: The IfcPhysicalQuantity to remove
|
||||
:type physical_quantity: ifcopenshell.entity_instance.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
Example::
|
||||
|
||||
schedule = ifcopenshell.api.run("cost.add_cost_schedule", model)
|
||||
item = ifcopenshell.api.run("cost.add_cost_item", model, cost_schedule=schedule)
|
||||
quantity = ifcopenshell.api.run("cost.add_cost_item_quantity", model,
|
||||
cost_item=item, ifc_class="IfcQuantityVolume")
|
||||
# Let's change our mind and delete it
|
||||
ifcopenshell.api.run("cost.remove_cost_item", model,
|
||||
cost_item=item, physical_quantity=quantity)
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {"cost_item": None, "physical_quantity": None}
|
||||
for key, value in settings.items():
|
||||
self.settings[key] = value
|
||||
self.settings = {"cost_item": cost_item, "physical_quantity": physical_quantity}
|
||||
|
||||
def execute(self):
|
||||
if len(self.file.get_inverse(self.settings["physical_quantity"])) == 1:
|
||||
|
||||
Reference in New Issue
Block a user