complete cost schedule exports commit 9dc69f3

This commit is contained in:
Sigma Dimensions
2023-02-15 23:09:15 +01:00
parent 2d4e4d2445
commit d2e02c8ab3
3 changed files with 465 additions and 2 deletions
+3 -2
View File
@@ -148,15 +148,16 @@ class Cost:
def expand_cost_item_rate(cls, cost_item): pass
def expand_cost_item(cls, cost_item): pass
def expand_cost_items(cls): pass
def export_cost_schedules(cls, format): pass
def get_active_cost_item(cls): pass
def get_all_nested_cost_items(cls, cost_item): pass
def get_attributes_for_cost_value(cls, cost_type, cost_category): pass
def get_cost_item_attributes(cls, cost_item): pass
def get_cost_item_products(cls): pass
def get_cost_item_quantity_attributes(cls): pass
def get_cost_item_value_formula(cls): pass
def get_cost_schedule_attributes(cls): pass
def get_cost_schedule_products(cls, cost_schedule): pass
def get_attributes_for_cost_value(cls, cost_type, cost_category): pass
def get_cost_value_attributes(cls): pass
def get_cost_value_unit_component(cls): pass
def get_direct_cost_item_products(cls): pass
@@ -165,6 +166,7 @@ class Cost:
def get_products(cls, related_object_type): pass
def get_root_cost_items(cls, cost_schedule): pass
def get_schedule_cost_items(cls, cost_schedule): pass
def get_units(cls):pass
def import_cost_schedule_csv(cls, file_path, is_schedule_of_rates): pass
def is_active_schedule_of_rates(cls): pass
def load_cost_item_attributes(cls): pass
@@ -177,7 +179,6 @@ class Cost:
def load_schedule_of_rates_tree(cls, schedule_of_rates): pass
def play_chaching_sound(cls): pass
def remove_cost_column(cls, name): pass
def export_cost_schedules(cls, format): pass
@interface
class Debug:
+24
View File
@@ -520,3 +520,27 @@ class Cost(blenderbim.core.tool.Cost):
writer = Ifc5DXlsxWriter(file=tool.Ifc.get(), output=path + ".xlsx")
writer.write()
@classmethod
def get_units(cls):
units = {}
for unit in tool.Ifc.get().by_type("IfcNamedUnit"):
if unit.get_info().get("UnitType", None) in [
"AREAUNIT",
"LENGTHUNIT",
"TIMEUNIT",
"VOLUMEUNIT",
"MASSUNIT",
"USERDEFINED",
]:
units[unit.id()] = cls.format_unit(unit)
return units
@staticmethod
def format_unit(unit):
if unit.is_a("IfcContextDependentUnit"):
return f"{unit.UnitType} / {unit.Name}"
else:
name = unit.Name
if unit.get_info().get("Prefix", None):
name = f"{unit.Prefix} {name}"
return f"{unit.UnitType} / {name}"