diff --git a/src/ifcblenderexport/io_export_ifc/__init__.py b/src/ifcblenderexport/io_export_ifc/__init__.py index 98e9889181..aa7cd72ff8 100644 --- a/src/ifcblenderexport/io_export_ifc/__init__.py +++ b/src/ifcblenderexport/io_export_ifc/__init__.py @@ -21,6 +21,7 @@ classes = ( operator.ExportIFC, ui.BIMProperties, ui.BIMPanel, + ui.MVDPanel, ) def menu_func(self, context): diff --git a/src/ifcblenderexport/io_export_ifc/export.py b/src/ifcblenderexport/io_export_ifc/export.py index d8ff53d104..41c5f982d9 100644 --- a/src/ifcblenderexport/io_export_ifc/export.py +++ b/src/ifcblenderexport/io_export_ifc/export.py @@ -1342,6 +1342,8 @@ class IfcExporter(): self.ifc_parser.psets[relating_property_key]['ifc']) def relate_objects_to_materials(self): + if not self.ifc_export_settings.has_representations: + return for relating_material_key, related_objects in self.ifc_parser.rel_associates_material.items(): self.file.createIfcRelAssociatesMaterial( ifcopenshell.guid.new(), self.owner_history, None, None, @@ -1349,6 +1351,8 @@ class IfcExporter(): self.ifc_parser.materials[relating_material_key]['ifc']) def relate_objects_to_material_layer_sets(self): + if not self.ifc_export_settings.has_representations: + return for product_index, related_materials in self.ifc_parser.rel_associates_material_layer_set.items(): material_layer_set = self.file.create_entity('IfcMaterialLayerSet', **{ 'MaterialLayers': [self.ifc_parser.materials[m]['layer_ifc'] for m in related_materials] @@ -1359,6 +1363,8 @@ class IfcExporter(): material_layer_set) def relate_objects_to_material_constituent_sets(self): + if not self.ifc_export_settings.has_representations: + return for product_index, related_materials in self.ifc_parser.rel_associates_material_constituent_set.items(): material_constituent_set = self.file.create_entity('IfcMaterialConstituentSet', **{ 'MaterialConstituents': [self.ifc_parser.materials[m]['constituent_ifc'] for m in related_materials] diff --git a/src/ifcblenderexport/io_export_ifc/operator.py b/src/ifcblenderexport/io_export_ifc/operator.py index d2244a76b3..2f476cb469 100644 --- a/src/ifcblenderexport/io_export_ifc/operator.py +++ b/src/ifcblenderexport/io_export_ifc/operator.py @@ -27,6 +27,7 @@ class ExportIFC(bpy.types.Operator): ifc_export_settings.data_dir = bpy.context.scene.BIMProperties.data_dir ifc_export_settings.schema_dir = bpy.context.scene.BIMProperties.schema_dir ifc_export_settings.output_file = bpy.path.ensure_ext(self.filepath, '.ifc') + ifc_export_settings.has_representations = bpy.context.scene.BIMProperties.export_has_representations ifc_parser = export.IfcParser(ifc_export_settings) ifc_schema = export.IfcSchema(ifc_export_settings) qto_calculator = export.QtoCalculator() diff --git a/src/ifcblenderexport/io_export_ifc/ui.py b/src/ifcblenderexport/io_export_ifc/ui.py index fc047707fe..7f7983c3dc 100644 --- a/src/ifcblenderexport/io_export_ifc/ui.py +++ b/src/ifcblenderexport/io_export_ifc/ui.py @@ -32,10 +32,11 @@ class BIMProperties(bpy.types.PropertyGroup): items = getIfcPredefinedTypes, name="Predefined Type", default=None) ifc_userdefined_type: bpy.props.StringProperty(name="Userdefined Type") + export_has_representations: bpy.props.BoolProperty(name="Export Representations", default=True) class BIMPanel(bpy.types.Panel): bl_label = "Building Information Modeling" - bl_idname = "SCENE_PT_layout" + bl_idname = "bim.panel" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "scene" @@ -68,3 +69,21 @@ class BIMPanel(bpy.types.Panel): row.prop(bim_properties, "ifc_userdefined_type") row = layout.row() row.operator("bim.assign_class") + +class MVDPanel(bpy.types.Panel): + bl_label = "Model View Definitions" + bl_idname = "mvd.panel" + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "scene" + + def draw(self, context): + layout = self.layout + + scene = context.scene + bim_properties = bpy.context.scene.BIMProperties + + layout.label(text="Custom MVD:") + + row = layout.row() + row.prop(bim_properties, "export_has_representations")