diff --git a/src/bonsai/bonsai/core/cost.py b/src/bonsai/bonsai/core/cost.py index 4ba7f69940..7ac985ac46 100644 --- a/src/bonsai/bonsai/core/cost.py +++ b/src/bonsai/bonsai/core/cost.py @@ -54,6 +54,8 @@ def enable_editing_cost_items(cost: tool.Cost, cost_schedule: ifcopenshell.entit cost.enable_editing_cost_items(cost_schedule) cost.load_active_schedule_columns() cost.load_cost_schedule_tree() + if not cost.is_active_schedule_of_rates() and (schedule_of_rates := cost.get_active_schedule_of_rates()): + cost.load_schedule_of_rates_tree(schedule_of_rates) cost.play_sound() diff --git a/src/bonsai/bonsai/tool/cost.py b/src/bonsai/bonsai/tool/cost.py index d9664898c7..2155c1d4ac 100644 --- a/src/bonsai/bonsai/tool/cost.py +++ b/src/bonsai/bonsai/tool/cost.py @@ -551,6 +551,14 @@ class Cost(bonsai.core.tool.Cost): props = bpy.context.scene.BIMCostProperties props.columns.remove(props.columns.find(name)) + @classmethod + def get_active_schedule_of_rates(cls) -> Union[ifcopenshell.entity_instance, None]: + props = bpy.context.scene.BIMCostProperties + schedule_id = tool.Blender.get_enum_safe(props, "schedule_of_rates") + if schedule_id is None: + return + return tool.Ifc.get().by_id(int(schedule_id)) + @classmethod def expand_cost_item_rate(cls, cost_item: ifcopenshell.entity_instance) -> None: props = bpy.context.scene.BIMCostProperties