mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 05:17:58 +00:00
You can now unload BCF projects to load another one.
This commit is contained in:
@@ -57,6 +57,7 @@ classes = (
|
|||||||
operator.SelectBcfBimSnippetReference,
|
operator.SelectBcfBimSnippetReference,
|
||||||
operator.SelectBcfDocumentReference,
|
operator.SelectBcfDocumentReference,
|
||||||
operator.SelectBcfHeaderFile,
|
operator.SelectBcfHeaderFile,
|
||||||
|
operator.UnloadBcfProject,
|
||||||
operator.ViewBcfTopic,
|
operator.ViewBcfTopic,
|
||||||
prop.BcfReferenceLink,
|
prop.BcfReferenceLink,
|
||||||
prop.BcfLabel,
|
prop.BcfLabel,
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ class LoadBcfProject(bpy.types.Operator):
|
|||||||
filter_glob: bpy.props.StringProperty(default="*.bcf;*.bcfzip", options={"HIDDEN"})
|
filter_glob: bpy.props.StringProperty(default="*.bcf;*.bcfzip", options={"HIDDEN"})
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
context.scene.BCFProperties.is_loaded = False
|
|
||||||
if self.filepath:
|
if self.filepath:
|
||||||
bcfstore.BcfStore.bcfxml = bcf.bcfxml.load(self.filepath)
|
bcfstore.BcfStore.bcfxml = bcf.bcfxml.load(self.filepath)
|
||||||
bcfxml = bcfstore.BcfStore.get_bcfxml()
|
bcfxml = bcfstore.BcfStore.get_bcfxml()
|
||||||
@@ -72,6 +71,17 @@ class LoadBcfProject(bpy.types.Operator):
|
|||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|
||||||
|
|
||||||
|
class UnloadBcfProject(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.unload_bcf_project"
|
||||||
|
bl_label = "Unload BCF Project"
|
||||||
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
bcfstore.BcfStore.set(None)
|
||||||
|
context.scene.BCFProperties.is_loaded = False
|
||||||
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class LoadBcfTopics(bpy.types.Operator):
|
class LoadBcfTopics(bpy.types.Operator):
|
||||||
bl_idname = "bim.load_bcf_topics"
|
bl_idname = "bim.load_bcf_topics"
|
||||||
bl_label = "Load BCF Topics"
|
bl_label = "Load BCF Topics"
|
||||||
|
|||||||
@@ -39,14 +39,16 @@ class BIM_PT_bcf(Panel):
|
|||||||
scene = context.scene
|
scene = context.scene
|
||||||
props = scene.BCFProperties
|
props = scene.BCFProperties
|
||||||
|
|
||||||
row = layout.row(align=True)
|
|
||||||
row.operator("bim.new_bcf_project", text="New Project")
|
|
||||||
row.operator("bim.load_bcf_project", text="Load Project")
|
|
||||||
|
|
||||||
if not props.is_loaded:
|
if not props.is_loaded:
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.operator("bim.new_bcf_project", text="New Project")
|
||||||
|
row.operator("bim.load_bcf_project", text="Load Project")
|
||||||
return
|
return
|
||||||
|
|
||||||
row.operator("bim.save_bcf_project", text="Save Project")
|
row = layout.row(align=True)
|
||||||
|
row.operator("bim.save_bcf_project", icon="EXPORT", text="Save Project")
|
||||||
|
row.operator("bim.unload_bcf_project", text="", icon="CANCEL")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(props, "name")
|
row.prop(props, "name")
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ class BIM_PT_project(Panel):
|
|||||||
op.should_save_as = False
|
op.should_save_as = False
|
||||||
op = row.operator("export_ifc.bim", icon="FILE_TICK", text="Save As")
|
op = row.operator("export_ifc.bim", icon="FILE_TICK", text="Save As")
|
||||||
op.should_save_as = True
|
op.should_save_as = True
|
||||||
row.operator("bim.unload_project", text="", icon="X")
|
row.operator("bim.unload_project", text="", icon="CANCEL")
|
||||||
|
|
||||||
def draw_create_project_ui(self, context):
|
def draw_create_project_ui(self, context):
|
||||||
props = context.scene.BIMProperties
|
props = context.scene.BIMProperties
|
||||||
|
|||||||
Reference in New Issue
Block a user