Make the audit class a drop down in the panel UI

This commit is contained in:
Dion Moult
2019-11-26 21:05:05 +11:00
parent afaa34ffc2
commit 44491c6167
3 changed files with 9 additions and 3 deletions
+5 -3
View File
@@ -189,9 +189,11 @@ class ApproveClass(bpy.types.Operator):
def execute(self, context):
with open(bpy.context.scene.BIMProperties.data_dir + 'audit.txt', 'a') as file:
for object in bpy.context.selected_objects:
index = object.BIMObjectProperties.attributes.find('GlobalId')
if index == -1:
continue
file.write('Then the element {} is an {}\n'.format(
object.BIMObjectProperties.attributes[
object.BIMObjectProperties.attributes.find('GlobalId')].string_value,
object.BIMObjectProperties.attributes[index].string_value,
object.name.split('/')[0]))
return {'FINISHED'}
@@ -205,7 +207,7 @@ class RejectClass(bpy.types.Operator):
file.write('Then the element {} is an {}\n'.format(
object.BIMObjectProperties.attributes[
object.BIMObjectProperties.attributes.find('GlobalId')].string_value,
bpy.context.scene.BIMProperties.ifc_class))
bpy.context.scene.BIMProperties.audit_ifc_class))
return {'FINISHED'}
class RejectElement(bpy.types.Operator):
+1
View File
@@ -129,6 +129,7 @@ def getApplicableDocuments(self, context):
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")
audit_ifc_class: EnumProperty(items=getIfcClasses, name="Audit Class")
ifc_class: EnumProperty(items=getIfcClasses, name="Class", update=refreshPredefinedTypes)
ifc_predefined_type: EnumProperty(
items = getIfcPredefinedTypes,
+3
View File
@@ -292,6 +292,9 @@ class BIM_PT_qa(Panel):
row.operator("bim.colour_by_class")
row.operator("bim.reset_object_colours")
row = layout.row()
row.prop(bim_properties, "audit_ifc_class")
row = layout.row(align=True)
row.operator("bim.approve_class")
row.operator("bim.reject_class")