mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 02:40:00 +00:00
Add ability to select a BCF file to be loaded
This commit is contained in:
@@ -34,6 +34,8 @@ if bpy is not None:
|
|||||||
operator.AssignClass,
|
operator.AssignClass,
|
||||||
operator.SelectClass,
|
operator.SelectClass,
|
||||||
operator.SelectType,
|
operator.SelectType,
|
||||||
|
operator.SelectBcfFile,
|
||||||
|
operator.GetBcfTopics,
|
||||||
operator.SelectFeaturesDir,
|
operator.SelectFeaturesDir,
|
||||||
operator.SelectDiffJsonFile,
|
operator.SelectDiffJsonFile,
|
||||||
operator.SelectDiffNewFile,
|
operator.SelectDiffNewFile,
|
||||||
@@ -121,6 +123,7 @@ if bpy is not None:
|
|||||||
ui.BIM_PT_documentation,
|
ui.BIM_PT_documentation,
|
||||||
ui.BIM_PT_bim,
|
ui.BIM_PT_bim,
|
||||||
ui.BIM_PT_search,
|
ui.BIM_PT_search,
|
||||||
|
ui.BIM_PT_bcf,
|
||||||
ui.BIM_PT_owner,
|
ui.BIM_PT_owner,
|
||||||
ui.BIM_PT_context,
|
ui.BIM_PT_context,
|
||||||
ui.BIM_PT_qa,
|
ui.BIM_PT_qa,
|
||||||
|
|||||||
@@ -385,6 +385,18 @@ class RejectElement(bpy.types.Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
class GetBcfTopics(bpy.types.Operator):
|
||||||
|
bl_idname = 'bim.get_bcf_topics'
|
||||||
|
bl_label = 'Get BCF Topics'
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
import bcfplugin
|
||||||
|
bcfplugin.openProject(bpy.context.scene.BIMProperties.bcf_file)
|
||||||
|
topics = bcfplugin.getTopics()
|
||||||
|
print(topics)
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class SelectAudited(bpy.types.Operator):
|
class SelectAudited(bpy.types.Operator):
|
||||||
bl_idname = 'bim.select_audited'
|
bl_idname = 'bim.select_audited'
|
||||||
bl_label = 'Select Audited'
|
bl_label = 'Select Audited'
|
||||||
@@ -821,6 +833,20 @@ class ExecuteIfcDiff(bpy.types.Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
class SelectBcfFile(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.select_bcf_file"
|
||||||
|
bl_label = "Select BCF File"
|
||||||
|
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
bpy.context.scene.BIMProperties.bcf_file = self.filepath
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
def invoke(self, context, event):
|
||||||
|
context.window_manager.fileselect_add(self)
|
||||||
|
return {'RUNNING_MODAL'}
|
||||||
|
|
||||||
|
|
||||||
class SelectFeaturesDir(bpy.types.Operator):
|
class SelectFeaturesDir(bpy.types.Operator):
|
||||||
bl_idname = "bim.select_features_dir"
|
bl_idname = "bim.select_features_dir"
|
||||||
bl_label = "Select Features Directory"
|
bl_label = "Select Features Directory"
|
||||||
|
|||||||
@@ -418,6 +418,7 @@ class BIMProperties(PropertyGroup):
|
|||||||
available_contexts: EnumProperty(items=[('Model', 'Model', ''), ('Plan', 'Plan', '')], name="Available Contexts")
|
available_contexts: EnumProperty(items=[('Model', 'Model', ''), ('Plan', 'Plan', '')], name="Available Contexts")
|
||||||
available_subcontexts: EnumProperty(items=getSubcontexts, name="Available Subcontexts")
|
available_subcontexts: EnumProperty(items=getSubcontexts, name="Available Subcontexts")
|
||||||
available_target_views: EnumProperty(items=getTargetViews, name="Available Target Views")
|
available_target_views: EnumProperty(items=getTargetViews, name="Available Target Views")
|
||||||
|
bcf_file: StringProperty(default='', name="BCF File")
|
||||||
|
|
||||||
|
|
||||||
class MapConversion(PropertyGroup):
|
class MapConversion(PropertyGroup):
|
||||||
|
|||||||
@@ -522,6 +522,29 @@ class BIM_PT_search(Panel):
|
|||||||
row.operator('bim.colour_by_pset', text='', icon='BRUSH_DATA')
|
row.operator('bim.colour_by_pset', text='', icon='BRUSH_DATA')
|
||||||
|
|
||||||
|
|
||||||
|
class BIM_PT_bcf(Panel):
|
||||||
|
bl_label = "BIM Collaboration Format"
|
||||||
|
bl_idname = "BIM_PT_bcf"
|
||||||
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
bl_space_type = 'PROPERTIES'
|
||||||
|
bl_region_type = 'WINDOW'
|
||||||
|
bl_context = "scene"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
layout.use_property_split = True
|
||||||
|
|
||||||
|
scene = context.scene
|
||||||
|
props = bpy.context.scene.BIMProperties
|
||||||
|
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.prop(props, "bcf_file")
|
||||||
|
row.operator("bim.select_bcf_file", icon="FILE_FOLDER", text="")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.operator("bim.get_bcf_topics")
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_qa(Panel):
|
class BIM_PT_qa(Panel):
|
||||||
bl_label = "BIMTester Quality Auditing"
|
bl_label = "BIMTester Quality Auditing"
|
||||||
bl_idname = "BIM_PT_qa"
|
bl_idname = "BIM_PT_qa"
|
||||||
|
|||||||
Reference in New Issue
Block a user