See #6570. Now the rate cost item pop up shows also the cost schedule

This commit is contained in:
Massimo Fabbro
2025-08-11 16:50:56 +02:00
committed by Massimo Fabbro
parent d57777290b
commit 94a3d58e49
3 changed files with 10 additions and 0 deletions
@@ -131,6 +131,7 @@ class CostSchedulesData:
cls._load_cost_values(cost_item, data)
cls._load_nesting_index(cost_item, data)
cls._load_assigned_cost_rate(cost_item, data)
cls._load_parent_cost_schedule(cost_item, data)
results[cost_item.id()] = data
return results
@@ -182,6 +183,10 @@ class CostSchedulesData:
def _load_assigned_cost_rate(cls, cost_item: ifcopenshell.entity_instance, data: CostItem) -> None:
data["AssignedCostRate"] = tool.Cost.get_assigned_rate_cost_item(cost_item)
@classmethod
def _load_parent_cost_schedule(cls, cost_item: ifcopenshell.entity_instance, data: CostItem) -> None:
data["ParentCostSchedule"] = tool.Cost.get_cost_schedule(cost_item)
@classmethod
def _load_cost_item_quantities(cls, cost_item: ifcopenshell.entity_instance, data: CostItem) -> None:
# parametric_quantities = []
@@ -701,6 +701,7 @@ class ShowAssignedCostRate(bpy.types.Operator):
bl_idname = "bim.show_assigned_cost_rate"
bl_label = "Info about the assigned cost item rate"
bl_options = {"REGISTER"}
parent_cost_schedule_name: bpy.props.StringProperty()
assigned_rate_identification: bpy.props.StringProperty()
assigned_rate_name: bpy.props.StringProperty()
assigned_rate_description: bpy.props.StringProperty()
@@ -717,6 +718,7 @@ class ShowAssignedCostRate(bpy.types.Operator):
def draw(self, context):
layout = self.layout
wrapper = textwrap.TextWrapper(width=80)
layout.label(text=f"COST SCHEDULE: {self.parent_cost_schedule_name}")
layout.label(text=f"ID: {self.assigned_rate_identification}")
layout.label(text=f"Name: {self.assigned_rate_name}")
layout.label(text="Description:")
+3
View File
@@ -734,6 +734,9 @@ class BIM_UL_cost_items_trait:
if cost_item["AssignedCostRate"] is not None:
op = row.operator("bim.show_assigned_cost_rate", text="", emboss=False, icon="ZOOM_IN")
identification = cost_item["AssignedCostRate"].Identification
op.parent_cost_schedule_name = CostSchedulesData.data["cost_items"][cost_item["AssignedCostRate"].id()][
"ParentCostSchedule"
].Name
op.assigned_rate_identification = identification if identification is not None else "XXX"
op.assigned_rate_name = cost_item["AssignedCostRate"].Name or ""
op.assigned_rate_description = cost_item["AssignedCostRate"].Description or ""