mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 01:30:04 +00:00
Implement BCF related topics
This commit is contained in:
@@ -35,6 +35,7 @@ if bpy is not None:
|
|||||||
operator.SelectType,
|
operator.SelectType,
|
||||||
operator.SelectBcfFile,
|
operator.SelectBcfFile,
|
||||||
operator.GetBcfTopics,
|
operator.GetBcfTopics,
|
||||||
|
operator.ViewBcfTopic,
|
||||||
operator.ActivateBcfViewpoint,
|
operator.ActivateBcfViewpoint,
|
||||||
operator.OpenBcfReferenceLink,
|
operator.OpenBcfReferenceLink,
|
||||||
operator.OpenBcfBimSnippetSchema,
|
operator.OpenBcfBimSnippetSchema,
|
||||||
@@ -113,6 +114,7 @@ if bpy is not None:
|
|||||||
prop.BcfTopicLabel,
|
prop.BcfTopicLabel,
|
||||||
prop.BcfTopicLink,
|
prop.BcfTopicLink,
|
||||||
prop.BcfTopicDocumentReference,
|
prop.BcfTopicDocumentReference,
|
||||||
|
prop.BcfTopicRelatedTopic,
|
||||||
prop.Subcontext,
|
prop.Subcontext,
|
||||||
prop.BIMProperties,
|
prop.BIMProperties,
|
||||||
prop.BCFProperties,
|
prop.BCFProperties,
|
||||||
|
|||||||
@@ -404,6 +404,18 @@ class GetBcfTopics(bpy.types.Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
class ViewBcfTopic(bpy.types.Operator):
|
||||||
|
bl_idname = 'bim.view_bcf_topic'
|
||||||
|
bl_label = 'Get BCF Topic'
|
||||||
|
topic_guid: bpy.props.StringProperty()
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
for index, topic in enumerate(bcf.BcfStore.topics):
|
||||||
|
if str(topic[1].xmlId) == self.topic_guid:
|
||||||
|
bpy.context.scene.BCFProperties.active_topic_index = index
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class ActivateBcfViewpoint(bpy.types.Operator):
|
class ActivateBcfViewpoint(bpy.types.Operator):
|
||||||
bl_idname = 'bim.activate_bcf_viewpoint'
|
bl_idname = 'bim.activate_bcf_viewpoint'
|
||||||
bl_label = 'Activate BCF Viewpoint'
|
bl_label = 'Activate BCF Viewpoint'
|
||||||
@@ -411,7 +423,7 @@ class ActivateBcfViewpoint(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
import bcfplugin
|
import bcfplugin
|
||||||
|
|
||||||
topics = bcfplugin.getTopics()
|
topics = bcf.BcfStore.topics
|
||||||
if not topics:
|
if not topics:
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
topic = topics[bpy.context.scene.BCFProperties.active_topic_index][1]
|
topic = topics[bpy.context.scene.BCFProperties.active_topic_index][1]
|
||||||
|
|||||||
@@ -379,6 +379,11 @@ class BcfTopicDocumentReference(PropertyGroup):
|
|||||||
is_external: BoolProperty(name='Is External')
|
is_external: BoolProperty(name='Is External')
|
||||||
|
|
||||||
|
|
||||||
|
class BcfTopicRelatedTopic(PropertyGroup):
|
||||||
|
name: StringProperty(name='Name')
|
||||||
|
guid: StringProperty(name='GUID')
|
||||||
|
|
||||||
|
|
||||||
def refreshBcfTopic(self, context):
|
def refreshBcfTopic(self, context):
|
||||||
global bcfviewpoints_enum
|
global bcfviewpoints_enum
|
||||||
import bcfplugin
|
import bcfplugin
|
||||||
@@ -444,6 +449,14 @@ def refreshBcfTopic(self, context):
|
|||||||
new.guid = str(doc.guid)
|
new.guid = str(doc.guid)
|
||||||
new.is_external = doc.external
|
new.is_external = doc.external
|
||||||
|
|
||||||
|
# Load related topics
|
||||||
|
while len(props.topic_related_topics) > 0:
|
||||||
|
props.topic_related_topics.remove(0)
|
||||||
|
for t in topic.relatedTopics:
|
||||||
|
new = props.topic_related_topics.add()
|
||||||
|
new.name = bcfplugin.getTopicFromUUID(t.value).title
|
||||||
|
new.guid = str(t.value)
|
||||||
|
|
||||||
# Load viewpoints
|
# Load viewpoints
|
||||||
bcfviewpoints_enum.clear()
|
bcfviewpoints_enum.clear()
|
||||||
viewpoints = bcfplugin.getViewpoints(topic)
|
viewpoints = bcfplugin.getViewpoints(topic)
|
||||||
@@ -558,6 +571,7 @@ class BCFProperties(PropertyGroup):
|
|||||||
topic_snippet_type: StringProperty(name='BIM Snippet Type')
|
topic_snippet_type: StringProperty(name='BIM Snippet Type')
|
||||||
topic_snippet_is_external: BoolProperty(name='Is BIM Snippet External')
|
topic_snippet_is_external: BoolProperty(name='Is BIM Snippet External')
|
||||||
topic_document_references: CollectionProperty(name='BCF Topic Document References', type=BcfTopicDocumentReference)
|
topic_document_references: CollectionProperty(name='BCF Topic Document References', type=BcfTopicDocumentReference)
|
||||||
|
topic_related_topics: CollectionProperty(name='BCF Topic Related Topics', type=BcfTopicRelatedTopic)
|
||||||
|
|
||||||
|
|
||||||
class MapConversion(PropertyGroup):
|
class MapConversion(PropertyGroup):
|
||||||
|
|||||||
@@ -613,6 +613,11 @@ class BIM_PT_bcf(Panel):
|
|||||||
row.operator('bim.open_bcf_document_reference', icon='FILE_FOLDER', text='').data = '{}/{}'.format(
|
row.operator('bim.open_bcf_document_reference', icon='FILE_FOLDER', text='').data = '{}/{}'.format(
|
||||||
props.topic_guid, index)
|
props.topic_guid, index)
|
||||||
|
|
||||||
|
layout.label(text="Related Topics:")
|
||||||
|
for topic in props.topic_related_topics:
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.operator('bim.view_bcf_topic', text=topic.name).topic_guid = topic.guid
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_qa(Panel):
|
class BIM_PT_qa(Panel):
|
||||||
bl_label = "BIMTester Quality Auditing"
|
bl_label = "BIMTester Quality Auditing"
|
||||||
|
|||||||
Reference in New Issue
Block a user