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