mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 11:20:21 +00:00
Fix #4638. You can now filter by parent (in the spatial hierarchy)
This commit is contained in:
@@ -304,6 +304,9 @@ def draw_filter(layout, filter_groups, data, module):
|
||||
elif ifc_filter.type == "group":
|
||||
row = box.row(align=True)
|
||||
row.prop(ifc_filter, "value", text="", icon="OUTLINER_COLLECTION")
|
||||
elif ifc_filter.type == "parent":
|
||||
row = box.row(align=True)
|
||||
row.prop(ifc_filter, "value", text="", icon="FILE_PARENT")
|
||||
elif ifc_filter.type == "query":
|
||||
row = box.row(align=True)
|
||||
row.prop(ifc_filter, "name", text="", icon="POINTCLOUD_DATA")
|
||||
|
||||
@@ -118,8 +118,9 @@ class BIMSearchProperties(PropertyGroup):
|
||||
("location", "Location", "", "PACKAGE", 5),
|
||||
("type", "Type", "", "FILE_VOLUME", 6),
|
||||
("group", "Group", "", "OUTLINER_COLLECTION", 7),
|
||||
("query", "Query", "", "POINTCLOUD_DATA", 8),
|
||||
("instance", "GlobalId", "", "GRIP", 9),
|
||||
("parent", "Parent", "", "FILE_PARENT", 8),
|
||||
("query", "Query", "", "POINTCLOUD_DATA", 9),
|
||||
("instance", "GlobalId", "", "GRIP", 10),
|
||||
],
|
||||
)
|
||||
saved_searches: EnumProperty(items=get_saved_searches, name="Saved Searches")
|
||||
|
||||
@@ -86,6 +86,9 @@ class Search(blenderbim.core.tool.Search):
|
||||
elif ifc_filter.type == "group":
|
||||
comparison, value = cls.get_comparison_and_value(ifc_filter)
|
||||
filter_group_query.append(f"group{comparison}{value}")
|
||||
elif ifc_filter.type == "parent":
|
||||
comparison, value = cls.get_comparison_and_value(ifc_filter)
|
||||
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)
|
||||
@@ -201,6 +204,10 @@ class ImportFilterQueryTransformer(lark.Transformer):
|
||||
comparison, value = args
|
||||
return {"type": "group", "value": f"{comparison}{value}"}
|
||||
|
||||
def parent(self, args):
|
||||
comparison, value = args
|
||||
return {"type": "parent", "value": f"{comparison}{value}"}
|
||||
|
||||
def query(self, args):
|
||||
keys, comparison, value = args
|
||||
return {"type": "query", "name": keys, "value": f"{comparison}{value}"}
|
||||
|
||||
Reference in New Issue
Block a user