mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Improved UI for adding cost item values
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user