mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Make the audit class a drop down in the panel UI
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user