mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
feat: add comparison property to ifc_filter in draw_filter and update search query logic
This commit is contained in:
committed by
Bruno Perdigão
parent
bd3250aff6
commit
14ed4d1d08
@@ -556,6 +556,7 @@ def draw_filter(
|
||||
elif ifc_filter.type == "query":
|
||||
row = box.row(align=True)
|
||||
row.prop(ifc_filter, "name", text="", icon="POINTCLOUD_DATA")
|
||||
row.prop(ifc_filter, "comparison", text="")
|
||||
row.prop(ifc_filter, "value", text="")
|
||||
elif ifc_filter.type == "instance":
|
||||
row = box.row(align=True)
|
||||
|
||||
@@ -121,7 +121,8 @@ class Search(bonsai.core.tool.Search):
|
||||
filter_group_query.append(f"parent{comparison}{value}")
|
||||
elif ifc_filter.type == "query":
|
||||
keys = cls.wrap_value(ifc_filter, ifc_filter.name)
|
||||
comparison, value = cls.get_comparison_and_value(ifc_filter)
|
||||
comparison = ifc_filter.comparison or "="
|
||||
value = cls.wrap_value(ifc_filter, ifc_filter.value)
|
||||
filter_group_query.append(f"query:{keys}{comparison}{value}")
|
||||
query.append(", ".join(filter_group_query))
|
||||
return " + ".join(query)
|
||||
|
||||
Reference in New Issue
Block a user