mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
You can now view and edit the BCF project name
This commit is contained in:
@@ -25,8 +25,8 @@ if bpy is not None:
|
||||
operator.UnassignClass,
|
||||
operator.SelectClass,
|
||||
operator.SelectType,
|
||||
operator.LoadBcfProject,
|
||||
operator.SaveBcfProject,
|
||||
operator.GetBcfTopics,
|
||||
operator.ViewBcfTopic,
|
||||
operator.ActivateBcfViewpoint,
|
||||
operator.OpenBcfFileReference,
|
||||
|
||||
@@ -507,15 +507,16 @@ class RejectElement(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class GetBcfTopics(bpy.types.Operator):
|
||||
bl_idname = "bim.get_bcf_topics"
|
||||
bl_label = "Get BCF Topics"
|
||||
class LoadBcfProject(bpy.types.Operator):
|
||||
bl_idname = "bim.load_bcf_project"
|
||||
bl_label = "Load BCF Project"
|
||||
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
||||
|
||||
def execute(self, context):
|
||||
import bcfplugin
|
||||
|
||||
bcfplugin.openProject(self.filepath)
|
||||
bpy.context.scene.BCFProperties.name = bcfplugin.getProjectName()
|
||||
bcf.BcfStore.topics = bcfplugin.getTopics()
|
||||
while len(bpy.context.scene.BCFProperties.topics) > 0:
|
||||
bpy.context.scene.BCFProperties.topics.remove(0)
|
||||
|
||||
@@ -947,6 +947,11 @@ def refreshBcfTopic(self, context):
|
||||
RefreshBcfTopic.refresh(context)
|
||||
|
||||
|
||||
def setBcfProjectName(self, context):
|
||||
import bcfplugin
|
||||
bcfplugin.setProjectName(self.name)
|
||||
|
||||
|
||||
class RefreshBcfTopic:
|
||||
props: None
|
||||
topic: None
|
||||
@@ -1599,6 +1604,7 @@ class BIMProperties(PropertyGroup):
|
||||
|
||||
|
||||
class BCFProperties(PropertyGroup):
|
||||
name: StringProperty(default="", name="Project Name", update=setBcfProjectName)
|
||||
topics: CollectionProperty(name="BCF Topics", type=BcfTopic)
|
||||
active_topic_index: IntProperty(name="Active BCF Topic Index", update=refreshBcfTopic)
|
||||
viewpoints: EnumProperty(items=getBcfViewpoints, name="BCF Viewpoints")
|
||||
|
||||
@@ -1660,11 +1660,19 @@ class BIM_PT_bcf(Panel):
|
||||
scene = context.scene
|
||||
props = bpy.context.scene.BCFProperties
|
||||
|
||||
row = layout.row()
|
||||
row.operator("bim.get_bcf_topics")
|
||||
row = layout.row(align=True)
|
||||
row.operator("bim.load_bcf_project")
|
||||
|
||||
if not props.topics:
|
||||
return
|
||||
|
||||
row.operator("bim.save_bcf_project")
|
||||
|
||||
row = layout.row()
|
||||
row.operator("bim.save_bcf_project")
|
||||
row.prop(props, "name")
|
||||
|
||||
if not props.topics:
|
||||
return
|
||||
|
||||
props = bpy.context.scene.BCFProperties
|
||||
layout.template_list("BIM_UL_topics", "", props, "topics", props, "active_topic_index")
|
||||
|
||||
Reference in New Issue
Block a user