From 9e360f7efaa5137baeaa373261792776df940f9d Mon Sep 17 00:00:00 2001 From: Sigma Dimensions <79010126+myoualid@users.noreply.github.com> Date: Wed, 3 May 2023 19:45:01 +0100 Subject: [PATCH] remove annoying print statement, run black on cost --- src/blenderbim/blenderbim/core/cost.py | 28 +++++++++++++++++++++++--- src/blenderbim/blenderbim/tool/pset.py | 1 - 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/blenderbim/blenderbim/core/cost.py b/src/blenderbim/blenderbim/core/cost.py index 383ab46009..9c4df303df 100644 --- a/src/blenderbim/blenderbim/core/cost.py +++ b/src/blenderbim/blenderbim/core/cost.py @@ -20,16 +20,19 @@ def enable_editing_cost_schedule_attributes(cost, cost_schedule): cost.load_cost_schedule_attributes(cost_schedule) cost.enable_editing_cost_schedule_attributes(cost_schedule) + def enable_editing_cost_items(cost, cost_schedule): cost.enable_editing_cost_items(cost_schedule) cost.load_cost_schedule_tree() cost.play_sound() + def add_summary_cost_item(ifc, cost, cost_schedule): ifc.run("cost.add_cost_item", cost_schedule=cost_schedule) cost.load_cost_schedule_tree() # cost.play_sound() + def add_cost_item(ifc, cost, cost_item): ifc.run("cost.add_cost_item", cost_item=cost_item) cost.load_cost_schedule_tree() @@ -175,54 +178,68 @@ def enable_editing_cost_item_value(cost, cost_value): def disable_editing_cost_item_value(cost): cost.disable_editing_cost_item_value() + def enable_editing_cost_item_value_formula(cost, cost_value): cost.load_cost_item_value_formula_attributes(cost_value) cost.enable_editing_cost_item_value_formula(cost_value) + def edit_cost_item_value_formula(ifc, cost, cost_value): formula = cost.get_cost_item_value_formula() ifc.run("cost.edit_cost_value_formula", cost_value=cost_value, formula=formula) cost.disable_editing_cost_item_value() + def edit_cost_value(ifc, cost, cost_value): attributes = cost.get_cost_value_attributes() ifc.run("cost.edit_cost_value", cost_value=cost_value, attributes=attributes) cost.disable_editing_cost_item_value() - #cost.load_cost_item_values(cost.get_active_cost_item()) + #cost.load_cost_item_values(cost.get_highlighted_cost_item()) + def copy_cost_item_values(ifc, cost, source, destination): ifc.run("cost.copy_cost_item_values", source=source, destination=destination) + def select_cost_item_products(cost, spatial, cost_item): is_deep = cost.show_nested_cost_item_elements() products = cost.get_cost_item_products(cost_item, is_deep) spatial.select_products(products) + def select_cost_schedule_products(cost, spatial, cost_schedule): products = cost.get_cost_schedule_products(cost_schedule) spatial.select_products(products) + def import_cost_schedule_csv(cost, file_path, is_schedule_of_rates): cost.import_cost_schedule_csv(file_path, is_schedule_of_rates) + def add_cost_column(cost, name): cost.add_cost_column(name) + def remove_cost_column(cost, name): cost.remove_cost_column(name) + def expand_cost_item_rate(cost, cost_item): cost.expand_cost_item_rate(cost_item) + def contract_cost_item_rate(cost, cost_item): cost.contract_cost_item_rate(cost_item) + def calculate_cost_item_resource_value(ifc, cost_item): ifc.run("cost.calculate_cost_item_resource_value", cost_item=cost_item) + def export_cost_schedules(cost, format): cost.export_cost_schedules(format) + def clear_cost_item_assignments(ifc, cost, cost_item, related_object_type): products = cost.get_cost_item_assignments(cost_item, filter_by_type=related_object_type) if products: @@ -230,6 +247,7 @@ def clear_cost_item_assignments(ifc, cost, cost_item, related_object_type): cost.load_cost_item_quantity_assignments(cost_item, related_object_type=related_object_type) cost.load_cost_schedule_tree() + def select_unassigned_products(ifc, cost, spatial): spatial.deselect_all() products = ifc.get().by_type("IfcElement") @@ -237,9 +255,11 @@ def select_unassigned_products(ifc, cost, spatial): selection = [product for product in products if not cost.has_cost_assignments(product, cost_schedule)] spatial.select_products(selection) + def load_product_cost_items(cost, product): cost.load_product_cost_items(product) + def highlight_product_cost_item(spatial, cost, cost_item): cost_schedule = cost.get_cost_schedule(cost_item) is_cost_schedule_active = cost.is_cost_schedule_active(cost_schedule) @@ -248,8 +268,10 @@ def highlight_product_cost_item(spatial, cost, cost_item): else: return "Cost schedule is not active" -def toggle_cost_item_parent(cost, cost_item): - cost.toggle_cost_item_parent(cost_item) + +def toggle_cost_item_parent_change(cost, cost_item): + cost.toggle_cost_item_parent_change(cost_item) + def change_parent_cost_item(ifc, cost, new_parent): cost_item = cost.get_active_cost_item() diff --git a/src/blenderbim/blenderbim/tool/pset.py b/src/blenderbim/blenderbim/tool/pset.py index 42469d5711..62f52bdecc 100644 --- a/src/blenderbim/blenderbim/tool/pset.py +++ b/src/blenderbim/blenderbim/tool/pset.py @@ -52,7 +52,6 @@ class Pset(blenderbim.core.tool.Pset): @classmethod def get_pset_name(cls, obj, obj_type): pset = cls.get_pset_props(obj, obj_type) - print(pset.pset_name) return pset.pset_name @classmethod