#2652 Removes all IFC data, and converts the file to a simple Blender file

This commit is contained in:
Ryan Schultz
2023-01-28 09:23:59 -06:00
committed by Dion Moult
parent 7df9640807
commit 87c67abac9
3 changed files with 24 additions and 0 deletions
@@ -30,6 +30,7 @@ classes = (
operator.ProfileImportIFC,
operator.PurgeHdf5Cache,
operator.PurgeIfcLinks,
operator.ConvertToBlender,
operator.RewindInspector,
operator.SelectExpressFile,
operator.SelectHighPolygonMeshes,
@@ -65,6 +65,26 @@ class PurgeIfcLinks(bpy.types.Operator):
return {"FINISHED"}
class ConvertToBlender(bpy.types.Operator):
bl_idname = "bim.converttoblender"
bl_label = "Convert To Blender File"
bl_description = "Removes all IFC data, and converts the file to a simple Blender file."
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
for o in bpy.data.objects:
if o.type in {'MESH', 'EMPTY'}:
o.BIMObjectProperties.ifc_definition_id = 0
if o.data:
o.data.BIMMeshProperties.ifc_definition_id = 0
for m in bpy.data.materials:
m.BIMMaterialProperties.ifc_style_id = False
bpy.context.scene.BIMProperties.ifc_file = ""
IfcStore.purge()
blenderbim.bim.handler.purge_module_data()
return {"FINISHED"}
class ValidateIfcFile(bpy.types.Operator):
bl_idname = "bim.validate_ifc_file"
bl_label = "Validate IFC File"
@@ -54,6 +54,9 @@ class BIM_PT_debug(Panel):
row = layout.row()
row.operator("bim.purge_ifc_links")
row = layout.row()
row.operator("bim.converttoblender")
row = layout.row()
row.operator("bim.create_all_shapes")