mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Eyedrop tool to visually select objects to export to IFC
This commit is contained in:
@@ -107,6 +107,7 @@ if bpy is not None:
|
||||
operator.RemoveCsvAttribute,
|
||||
operator.ExportIfcCsv,
|
||||
operator.ImportIfcCsv,
|
||||
operator.EyedropIfcCsv,
|
||||
prop.StrProperty,
|
||||
prop.Classification,
|
||||
prop.ClassificationReference,
|
||||
|
||||
@@ -2076,3 +2076,17 @@ class ImportIfcCsv(bpy.types.Operator):
|
||||
ifc_csv.output = self.filepath
|
||||
ifc_csv.Import(bpy.context.scene.BIMProperties.ifc_file)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class EyedropIfcCsv(bpy.types.Operator):
|
||||
bl_idname = 'bim.eyedrop_ifccsv'
|
||||
bl_label = 'Query Selected Items'
|
||||
|
||||
def execute(self, context):
|
||||
global_ids = []
|
||||
for obj in bpy.context.selected_objects:
|
||||
if hasattr(obj, 'BIMObjectProperties') \
|
||||
and obj.BIMObjectProperties.attributes.get('GlobalId'):
|
||||
global_ids.append('#' + obj.BIMObjectProperties.attributes.get('GlobalId').string_value)
|
||||
bpy.context.scene.BIMProperties.ifc_selector = '|'.join(global_ids)
|
||||
return {'FINISHED'}
|
||||
|
||||
@@ -662,8 +662,9 @@ class BIM_PT_ifccsv(Panel):
|
||||
scene = context.scene
|
||||
props = scene.BIMProperties
|
||||
|
||||
row = layout.row()
|
||||
row = layout.row(align=True)
|
||||
row.prop(props, 'ifc_selector')
|
||||
row.operator('bim.eyedrop_ifccsv', icon='EYEDROPPER', text='')
|
||||
|
||||
row = layout.row()
|
||||
row.operator('bim.add_csv_attribute')
|
||||
|
||||
Reference in New Issue
Block a user