mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 01:11:40 +00:00
Fix #4494 - Be able to search (select objects in scene) from the Spreadsheet Import/Export UI, as well.
This commit is contained in:
@@ -87,6 +87,11 @@ class BIM_PT_ifccsv(Panel):
|
||||
|
||||
blenderbim.bim.helper.draw_filter(self.layout, props.filter_groups, SearchData, "csv")
|
||||
|
||||
row = layout.row(align=True)
|
||||
op = row.operator("bim.search", text="Select", icon="VIEWZOOM")
|
||||
op.property_group = "CsvProperties"
|
||||
layout.separator()
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator("bim.add_csv_attribute", icon="ADD")
|
||||
row.prop(props, "should_show_sort", icon="SORTSIZE", text="")
|
||||
@@ -123,3 +128,6 @@ class BIM_PT_ifccsv(Panel):
|
||||
row = layout.row(align=True)
|
||||
row.operator("bim.export_ifccsv", icon="EXPORT", text="Export IFC to " + props.format.upper())
|
||||
row.operator("bim.import_ifccsv", icon="IMPORT")
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -168,8 +168,13 @@ class Search(Operator):
|
||||
bl_idname = "bim.search"
|
||||
bl_label = "Search"
|
||||
|
||||
property_group: bpy.props.StringProperty(name="Property Group", default="")
|
||||
|
||||
def execute(self, context):
|
||||
props = context.scene.BIMSearchProperties
|
||||
if self.property_group == "CsvProperties":
|
||||
props = context.scene.CsvProperties
|
||||
elif self.property_group == "BIMSearchProperties":
|
||||
props = context.scene.BIMSearchProperties
|
||||
results = ifcopenshell.util.selector.filter_elements(
|
||||
tool.Ifc.get(), tool.Search.export_filter_query(props.filter_groups)
|
||||
)
|
||||
|
||||
@@ -40,7 +40,8 @@ class BIM_PT_search(Panel):
|
||||
|
||||
if len(props.filter_groups):
|
||||
row = self.layout.row(align=True)
|
||||
row.operator("bim.search", text="Search", icon="VIEWZOOM")
|
||||
op = row.operator("bim.search", text="Search", icon="VIEWZOOM")
|
||||
op.property_group = "BIMSearchProperties" # Pass property group name
|
||||
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user