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