mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:32:37 +00:00
New feature to select similar type
This commit is contained in:
@@ -109,6 +109,7 @@ if bpy is not None:
|
|||||||
operator.ImportIfcCsv,
|
operator.ImportIfcCsv,
|
||||||
operator.EyedropIfcCsv,
|
operator.EyedropIfcCsv,
|
||||||
operator.ReloadIfcFile,
|
operator.ReloadIfcFile,
|
||||||
|
operator.SelectSimilarType,
|
||||||
prop.StrProperty,
|
prop.StrProperty,
|
||||||
prop.Classification,
|
prop.Classification,
|
||||||
prop.ClassificationReference,
|
prop.ClassificationReference,
|
||||||
|
|||||||
@@ -2212,3 +2212,20 @@ class ReloadIfcFile(bpy.types.Operator):
|
|||||||
context, bpy.context.scene.BIMProperties.ifc_file, logger)
|
context, bpy.context.scene.BIMProperties.ifc_file, logger)
|
||||||
ifc_importer = import_ifc.IfcImporter(ifc_import_settings)
|
ifc_importer = import_ifc.IfcImporter(ifc_import_settings)
|
||||||
ifc_importer.execute()
|
ifc_importer.execute()
|
||||||
|
|
||||||
|
|
||||||
|
class SelectSimilarType(bpy.types.Operator):
|
||||||
|
bl_idname = 'bim.select_similar_type'
|
||||||
|
bl_label = 'Select Similar Type'
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
if context.active_object.BIMObjectProperties.relating_type:
|
||||||
|
relating_type = context.active_object.BIMObjectProperties.relating_type
|
||||||
|
elif 'Type/' in context.active_object.name:
|
||||||
|
relating_type = context.active_object
|
||||||
|
else:
|
||||||
|
return {'FINISHED'}
|
||||||
|
for obj in bpy.context.visible_objects:
|
||||||
|
if obj.BIMObjectProperties.relating_type == relating_type:
|
||||||
|
obj.select_set(True)
|
||||||
|
return {'FINISHED'}
|
||||||
|
|||||||
@@ -41,8 +41,9 @@ class BIM_PT_object(Panel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(props, 'attributes')
|
row.prop(props, 'attributes')
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row(align=True)
|
||||||
row.prop(props, 'relating_type')
|
row.prop(props, 'relating_type')
|
||||||
|
row.operator('bim.select_similar_type', icon='RESTRICT_SELECT_OFF', text='')
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(props, 'relating_structure')
|
row.prop(props, 'relating_structure')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user