mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 17:16:24 +00:00
New feature to validate IFC files against specification
This commit is contained in:
@@ -11,6 +11,7 @@ from . import cut_ifc
|
||||
from . import sheeter
|
||||
from . import schema
|
||||
from . import bcf
|
||||
from . import ifc
|
||||
from bpy_extras.io_utils import ImportHelper
|
||||
from itertools import cycle
|
||||
from mathutils import Vector, Matrix
|
||||
@@ -993,6 +994,22 @@ class SelectIfcFile(bpy.types.Operator):
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
class ValidateIfcFile(bpy.types.Operator):
|
||||
bl_idname = 'bim.validate_ifc_file'
|
||||
bl_label = 'Validate IFC File'
|
||||
|
||||
def execute(self, context):
|
||||
import ifcopenshell.validate
|
||||
logger = logging.getLogger('validate')
|
||||
logger.setLevel(logging.DEBUG)
|
||||
if bpy.context.scene.BIMProperties.ifc_file \
|
||||
and bpy.context.scene.BIMProperties.ifc_file != ifc.IfcStore.path:
|
||||
ifc.IfcStore.file = ifcopenshell.open(bpy.context.scene.BIMProperties.ifc_file)
|
||||
ifc.IfcStore.path = bpy.context.scene.BIMProperties.ifc_file
|
||||
ifcopenshell.validate.validate(ifc.IfcStore.file, logger)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class SelectDataDir(bpy.types.Operator):
|
||||
bl_idname = "bim.select_data_dir"
|
||||
bl_label = "Select Data Directory"
|
||||
|
||||
Reference in New Issue
Block a user