Allow users to toggle import of opening elements.

This commit is contained in:
Dion Moult
2020-01-31 12:52:44 +11:00
parent bb462659a3
commit 9571d4a67b
4 changed files with 11 additions and 1 deletions
@@ -147,7 +147,8 @@ class IfcImporter():
self.create_project()
self.create_spatial_hierarchy()
self.create_aggregates()
self.create_openings_collection()
if self.ifc_import_settings.should_import_opening_elements:
self.create_openings_collection()
self.purge_diff()
self.patch_ifc()
self.create_type_products()
@@ -276,6 +277,10 @@ class IfcImporter():
element = self.file.by_id(shape.guid)
if not self.ifc_import_settings.should_import_opening_elements \
and element.is_a('IfcOpeningElement'):
return
self.ifc_import_settings.logger.info('Creating object {}'.format(element))
# TODO: make names more meaningful
@@ -595,6 +600,7 @@ class IfcImportSettings:
self.should_ignore_building_coordinates = False
self.should_reset_absolute_coordinates = False
self.should_import_curves = False
self.should_import_opening_elements = False
self.should_treat_styled_item_as_material = False
self.should_use_cpu_multiprocessing = False
self.should_use_legacy = False
@@ -81,6 +81,7 @@ class ImportIFC(bpy.types.Operator, ImportHelper):
ifc_import_settings.should_ignore_site_coordinates = bpy.context.scene.BIMProperties.import_should_ignore_site_coordinates
ifc_import_settings.should_ignore_building_coordinates = bpy.context.scene.BIMProperties.import_should_ignore_building_coordinates
ifc_import_settings.should_import_curves = bpy.context.scene.BIMProperties.import_should_import_curves
ifc_import_settings.should_import_opening_elements = bpy.context.scene.BIMProperties.import_should_import_opening_elements
ifc_import_settings.should_auto_set_workarounds = bpy.context.scene.BIMProperties.import_should_auto_set_workarounds
ifc_import_settings.should_treat_styled_item_as_material = bpy.context.scene.BIMProperties.import_should_treat_styled_item_as_material
ifc_import_settings.should_use_cpu_multiprocessing = bpy.context.scene.BIMProperties.import_should_use_cpu_multiprocessing
+1
View File
@@ -376,6 +376,7 @@ class BIMProperties(PropertyGroup):
import_should_ignore_building_coordinates: BoolProperty(name="Import Ignoring Building Coordinates", default=False)
import_should_reset_absolute_coordinates: BoolProperty(name="Import Resetting Absolute Coordinates", default=False)
import_should_import_curves: BoolProperty(name="Import Curves", default=False)
import_should_import_opening_elements: BoolProperty(name="Import Opening Elements", default=False)
import_should_auto_set_workarounds: BoolProperty(name="Automatically Set Vendor Workarounds", default=True)
import_should_treat_styled_item_as_material: BoolProperty(name="Import Treating Styled Item as Material", default=False)
import_should_use_legacy: BoolProperty(name="Import with Legacy Importer", default=False)
+2
View File
@@ -589,6 +589,8 @@ class BIM_PT_mvd(Panel):
row.prop(bim_properties, 'export_has_representations')
row = layout.row()
row.prop(bim_properties, 'import_should_import_curves')
row = layout.row()
row.prop(bim_properties, 'import_should_import_opening_elements')
layout.label(text='Experimental Modes:')