mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Auto update cost item rates when enabling editing non-sor cost schedule
There was an issue that it wouldn't load until you manually select it in the "Cost Item Rates" enum - otherwise items didn't appear the first time cost schedule opened and didn't not update when you makes changes to the active schedule of rates.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user