mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
tweaked active operator
This commit is contained in:
@@ -104,8 +104,8 @@ def draw_psetqto_ui(
|
||||
) -> None:
|
||||
|
||||
|
||||
select_similar_op = context.active_operator
|
||||
calculated_sum = getattr(select_similar_op, "calculated_sum", 0.0)
|
||||
active_operator = context.active_operator
|
||||
|
||||
|
||||
filter_keyword = filter_keyword.lower()
|
||||
box = layout.box()
|
||||
@@ -201,9 +201,11 @@ def draw_psetqto_ui(
|
||||
op = row.operator("bim.select_similar", text=nominal_value, icon="NONE", emboss=False)
|
||||
op.key = '"' + pset["Name"].replace('"', '\\"') + '"."' + prop["Name"].replace('"', '\\"') + '"'
|
||||
# calculate sum of all selected objects
|
||||
if select_similar_op:
|
||||
if op.key == select_similar_op.key and calculated_sum != 0 and isinstance(float(nominal_value), (int, float)):
|
||||
row.label(text=f"(Sum: {calculated_sum})")
|
||||
if active_operator:
|
||||
if active_operator.bl_idname == "BIM_OT_select_similar":
|
||||
calculated_sum = getattr(active_operator, "calculated_sum", 0.0)
|
||||
if op.key == active_operator.key and calculated_sum != 0 and isinstance(float(nominal_value), (int, float)):
|
||||
row.label(text=f"(Sum: {calculated_sum})")
|
||||
if not has_props_displayed:
|
||||
row = box.row()
|
||||
row.scale_y = 0.8
|
||||
|
||||
Reference in New Issue
Block a user