mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 20:50:02 +00:00
Add new feature to select object by GlobalId
This commit is contained in:
@@ -39,12 +39,16 @@ classes = (
|
|||||||
operator.AddAttribute,
|
operator.AddAttribute,
|
||||||
operator.RemoveAttribute,
|
operator.RemoveAttribute,
|
||||||
operator.QuickProjectSetup,
|
operator.QuickProjectSetup,
|
||||||
|
operator.SelectGlobalId,
|
||||||
ui.BIMProperties,
|
ui.BIMProperties,
|
||||||
|
ui.MapConversion,
|
||||||
|
ui.TargetCRS,
|
||||||
ui.Attribute,
|
ui.Attribute,
|
||||||
ui.Pset,
|
ui.Pset,
|
||||||
ui.ObjectProperties,
|
ui.ObjectProperties,
|
||||||
ui.MaterialProperties,
|
ui.MaterialProperties,
|
||||||
ui.MeshProperties,
|
ui.MeshProperties,
|
||||||
|
ui.GISPanel,
|
||||||
ui.BIMPanel,
|
ui.BIMPanel,
|
||||||
ui.MVDPanel,
|
ui.MVDPanel,
|
||||||
ui.MaterialPanel,
|
ui.MaterialPanel,
|
||||||
@@ -66,6 +70,8 @@ def register():
|
|||||||
bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
|
bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
|
||||||
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
|
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
|
||||||
bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=ui.BIMProperties)
|
bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=ui.BIMProperties)
|
||||||
|
bpy.types.Scene.MapConversion = bpy.props.PointerProperty(type=ui.MapConversion)
|
||||||
|
bpy.types.Scene.TargetCRS = bpy.props.PointerProperty(type=ui.TargetCRS)
|
||||||
bpy.types.Object.ObjectProperties = bpy.props.PointerProperty(type=ui.ObjectProperties)
|
bpy.types.Object.ObjectProperties = bpy.props.PointerProperty(type=ui.ObjectProperties)
|
||||||
bpy.types.Collection.ObjectProperties = bpy.props.PointerProperty(type=ui.ObjectProperties)
|
bpy.types.Collection.ObjectProperties = bpy.props.PointerProperty(type=ui.ObjectProperties)
|
||||||
bpy.types.Material.MaterialProperties = bpy.props.PointerProperty(type=ui.MaterialProperties)
|
bpy.types.Material.MaterialProperties = bpy.props.PointerProperty(type=ui.MaterialProperties)
|
||||||
@@ -77,6 +83,8 @@ def unregister():
|
|||||||
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
|
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
|
||||||
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
|
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
|
||||||
del(bpy.types.Scene.BIMProperties)
|
del(bpy.types.Scene.BIMProperties)
|
||||||
|
del(bpy.types.Scene.MapConversion)
|
||||||
|
del(bpy.types.Scene.TargetCRS)
|
||||||
del(bpy.types.Object.ObjectProperties)
|
del(bpy.types.Object.ObjectProperties)
|
||||||
del(bpy.types.Collection.ObjectProperties)
|
del(bpy.types.Collection.ObjectProperties)
|
||||||
del(bpy.types.Material.MaterialProperties)
|
del(bpy.types.Material.MaterialProperties)
|
||||||
|
|||||||
@@ -61,6 +61,19 @@ class ImportIFC(bpy.types.Operator, ImportHelper):
|
|||||||
ifc_import_settings.logger.info('Import finished in {:.2f} seconds'.format(time.time() - start))
|
ifc_import_settings.logger.info('Import finished in {:.2f} seconds'.format(time.time() - start))
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
class SelectGlobalId(bpy.types.Operator):
|
||||||
|
bl_idname = 'bim.select_global_id'
|
||||||
|
bl_label = 'Select GlobalId'
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
for object in bpy.context.visible_objects:
|
||||||
|
index = object.ObjectProperties.attributes.find('GlobalId')
|
||||||
|
if index != -1 \
|
||||||
|
and object.ObjectProperties.attributes[index].string_value == bpy.context.scene.BIMProperties.global_id:
|
||||||
|
object.select_set(True)
|
||||||
|
break
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
class AssignClass(bpy.types.Operator):
|
class AssignClass(bpy.types.Operator):
|
||||||
bl_idname = 'bim.assign_class'
|
bl_idname = 'bim.assign_class'
|
||||||
bl_label = 'Assign IFC Class'
|
bl_label = 'Assign IFC Class'
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class BIMProperties(bpy.types.PropertyGroup):
|
|||||||
pset_name: bpy.props.EnumProperty(items=getPsetNames, name="Pset Name")
|
pset_name: bpy.props.EnumProperty(items=getPsetNames, name="Pset Name")
|
||||||
pset_file: bpy.props.EnumProperty(items=getPsetFiles, name="Pset File")
|
pset_file: bpy.props.EnumProperty(items=getPsetFiles, name="Pset File")
|
||||||
has_georeferencing: bpy.props.BoolProperty(name="Has Georeferencing", default=False)
|
has_georeferencing: bpy.props.BoolProperty(name="Has Georeferencing", default=False)
|
||||||
|
global_id: bpy.props.StringProperty(name="GlobalId")
|
||||||
|
|
||||||
class MapConversion(bpy.types.PropertyGroup):
|
class MapConversion(bpy.types.PropertyGroup):
|
||||||
eastings: bpy.props.StringProperty(name="Eastings")
|
eastings: bpy.props.StringProperty(name="Eastings")
|
||||||
@@ -241,6 +242,13 @@ class BIMPanel(bpy.types.Panel):
|
|||||||
row.prop(bim_properties, "data_dir")
|
row.prop(bim_properties, "data_dir")
|
||||||
row.operator("bim.select_data_dir", icon="FILE_FOLDER", text="")
|
row.operator("bim.select_data_dir", icon="FILE_FOLDER", text="")
|
||||||
|
|
||||||
|
layout.label(text="Software Identity:")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(bim_properties, 'global_id')
|
||||||
|
row = layout.row()
|
||||||
|
row.operator('bim.select_global_id')
|
||||||
|
|
||||||
layout.label(text="IFC Categorisation:")
|
layout.label(text="IFC Categorisation:")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
|
|||||||
Reference in New Issue
Block a user