Improved UI for adding cost item values

This commit is contained in:
Sigma Dimensions
2023-03-29 01:38:21 +00:00
parent da84165e13
commit 73feadcd66
3 changed files with 4 additions and 1 deletions
@@ -175,6 +175,7 @@ class BIMCostProperties(PropertyGroup):
name="Cost Types",
)
cost_category: StringProperty(name="Cost Category")
fixed_cost_value: FloatProperty(name="Fixed Cost Value")
active_cost_value_id: IntProperty(name="Active Cost Item Value Id")
cost_value_editing_type: StringProperty(name="Cost Value Editing Type")
cost_value_attributes: CollectionProperty(name="Cost Value Attributes", type=Attribute)
@@ -176,6 +176,8 @@ class BIM_PT_cost_schedules(Panel):
def draw_editable_cost_item_values_ui(self):
row = self.layout.row(align=True)
row.prop(self.props, "cost_types", text="")
if self.props.cost_types == "FIXED":
row.prop(self.props, "fixed_cost_value", text="")
if self.props.cost_types == "CATEGORY":
row.prop(self.props, "cost_category", text="")
op = row.operator("bim.add_cost_value", text="Add Value", icon="ADD")
+1 -1
View File
@@ -267,7 +267,7 @@ class Cost(blenderbim.core.tool.Cost):
def get_attributes_for_cost_value(cls, cost_type, cost_category):
if cost_type == "FIXED":
category = None
attributes = {"AppliedValue": 0.0}
attributes = {"AppliedValue": bpy.context.scene.BIMCostProperties.fixed_cost_value}
elif cost_type == "SUM":
category = "*"
attributes = {"Category": category}