Add list of BCF topics in UI

This commit is contained in:
Dion Moult
2020-03-21 21:44:02 +11:00
parent 5454521c2a
commit 65a5dcbe25
4 changed files with 28 additions and 2 deletions
@@ -103,6 +103,7 @@ if bpy is not None:
operator.ExecuteIfcDiff,
operator.AssignContext,
operator.SetViewPreset1,
prop.BcfTopic,
prop.Subcontext,
prop.BIMProperties,
prop.DocProperties,
@@ -135,6 +136,7 @@ if bpy is not None:
ui.BIM_PT_mesh,
ui.BIM_PT_object,
ui.BIM_PT_camera,
ui.BIM_UL_topics,
)
def menu_func_export(self, context):
+5 -1
View File
@@ -393,7 +393,11 @@ class GetBcfTopics(bpy.types.Operator):
import bcfplugin
bcfplugin.openProject(bpy.context.scene.BIMProperties.bcf_file)
topics = bcfplugin.getTopics()
print(topics)
while len(bpy.context.scene.BIMProperties.bcf_topics) > 0:
bpy.context.scene.BIMProperties.bcf_topics.remove(0)
for topic in topics:
new = bpy.context.scene.BIMProperties.bcf_topics.add()
new.name = topic[0]
return {'FINISHED'}
+9 -1
View File
@@ -358,6 +358,12 @@ class BIMCameraProperties(PropertyGroup):
diagram_scale: EnumProperty(items=getDiagramScales, name='Diagram Scale')
class BcfTopic(PropertyGroup):
name: StringProperty(name='Name')
# TODO: Make this not wrong
target_view: StringProperty(name='Target View')
class BIMProperties(PropertyGroup):
schema_dir: StringProperty(default=os.path.join(cwd ,'schema') + os.path.sep, name="Schema Directory")
data_dir: StringProperty(default=os.path.join(cwd, 'data') + os.path.sep, name="Data Directory")
@@ -418,7 +424,9 @@ class BIMProperties(PropertyGroup):
available_contexts: EnumProperty(items=[('Model', 'Model', ''), ('Plan', 'Plan', '')], name="Available Contexts")
available_subcontexts: EnumProperty(items=getSubcontexts, name="Available Subcontexts")
available_target_views: EnumProperty(items=getTargetViews, name="Available Target Views")
bcf_file: StringProperty(default='', name="BCF File")
bcf_file: StringProperty(default='', name='BCF File')
bcf_topics: CollectionProperty(name='BCF Topics', type=BcfTopic)
active_bcf_topic_index: IntProperty(name='Active BCF Topic Index')
class MapConversion(PropertyGroup):
+12
View File
@@ -544,6 +544,9 @@ class BIM_PT_bcf(Panel):
row = layout.row()
row.operator("bim.get_bcf_topics")
props = bpy.context.scene.BIMProperties
layout.template_list('BIM_UL_topics', '', props, 'bcf_topics', props, 'active_bcf_topic_index')
class BIM_PT_qa(Panel):
bl_label = "BIMTester Quality Auditing"
@@ -721,3 +724,12 @@ class BIM_PT_mvd(Panel):
row.prop(bim_properties, 'import_should_ignore_building_coordinates')
row = layout.row()
row.prop(bim_properties, 'import_should_treat_styled_item_as_material')
class BIM_UL_topics(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
ob = data
if item:
layout.prop(item, 'name', text='', emboss=False)
else:
layout.label(text="", translate=False)