mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 05:52:33 +00:00
- Improve ODS export
- Fix XLSX export bug - Improve active cost item UI active cost item - Fix missing tool cost function
This commit is contained in:
@@ -175,7 +175,7 @@ class BIM_PT_cost_schedules(Panel):
|
||||
row.prop(self.props, "cost_types", text="")
|
||||
if self.props.cost_types == "CATEGORY":
|
||||
row.prop(self.props, "cost_category", text="")
|
||||
op = row.operator("bim.add_cost_value", text="", icon="ADD")
|
||||
op = row.operator("bim.add_cost_value", text="Add Value", icon="ADD")
|
||||
op.parent = self.props.active_cost_item_id
|
||||
op.cost_type = self.props.cost_types
|
||||
if self.props.cost_types == "CATEGORY":
|
||||
@@ -511,6 +511,8 @@ class BIM_UL_cost_items_trait:
|
||||
|
||||
self.draw_quantity_column(split2, cost_item)
|
||||
self.draw_value_column(split2, cost_item)
|
||||
if self.props.active_cost_item_id == item.ifc_definition_id:
|
||||
row.operator("bim.disable_editing_cost_item", text="", icon="CANCEL")
|
||||
|
||||
for column in self.props.columns:
|
||||
split2.label(text=str(cost_item["CategoryValues"].get(column.name, "-")))
|
||||
|
||||
@@ -314,6 +314,10 @@ class Cost(blenderbim.core.tool.Cost):
|
||||
)
|
||||
blenderbim.bim.helper.import_attributes2(cost_value, props.cost_value_attributes, callback=callback)
|
||||
|
||||
@classmethod
|
||||
def calculate_applied_value(cls, cost_item, cost_value):
|
||||
return ifcopenshell.util.cost.calculate_applied_value(cost_item, cost_value)
|
||||
|
||||
@classmethod
|
||||
def is_active_schedule_of_rates(cls):
|
||||
return (
|
||||
@@ -336,7 +340,7 @@ class Cost(blenderbim.core.tool.Cost):
|
||||
@classmethod
|
||||
def load_cost_item_value_formula_attributes(cls, cost_value=None):
|
||||
props = bpy.context.scene.BIMCostProperties
|
||||
props.cost_value_attributes.clear() # why is this necessary?
|
||||
props.cost_value_attributes.clear()
|
||||
bpy.context.scene.BIMCostProperties.cost_value_formula = ifcopenshell.util.cost.serialise_cost_value(cost_value)
|
||||
|
||||
@classmethod
|
||||
@@ -517,7 +521,7 @@ class Cost(blenderbim.core.tool.Cost):
|
||||
elif format == "XLSX":
|
||||
from ifc5d.ifc5Dspreadsheet import Ifc5DXlsxWriter
|
||||
|
||||
writer = Ifc5DXlsxWriter(file=tool.Ifc.get(), output=path + ".xlsx")
|
||||
writer = Ifc5DXlsxWriter(file=tool.Ifc.get(), output=path)
|
||||
writer.write()
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user