mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
New import option to toggle the import of space objects
This commit is contained in:
@@ -300,6 +300,10 @@ class IfcImporter():
|
||||
and element.is_a('IfcOpeningElement'):
|
||||
return
|
||||
|
||||
if not self.ifc_import_settings.should_import_spaces \
|
||||
and element.is_a('IfcSpace'):
|
||||
return
|
||||
|
||||
self.ifc_import_settings.logger.info('Creating object {}'.format(element))
|
||||
|
||||
# TODO: make names more meaningful
|
||||
@@ -462,10 +466,10 @@ class IfcImporter():
|
||||
bpy.ops.object.delete({'selected_objects': objects_to_purge})
|
||||
|
||||
def create_object(self, element):
|
||||
if self.diff:
|
||||
if element.GlobalId not in self.diff['added'] \
|
||||
if self.diff \
|
||||
and element.GlobalId not in self.diff['added'] \
|
||||
and element.GlobalId not in self.diff['changed'].keys():
|
||||
return
|
||||
return
|
||||
|
||||
self.ifc_import_settings.logger.info('Creating object {}'.format(element))
|
||||
self.time = time.time()
|
||||
@@ -517,6 +521,10 @@ class IfcImporter():
|
||||
and element.Decomposes:
|
||||
if element.Decomposes[0].RelatingObject.is_a('IfcProject'):
|
||||
collection = bpy.data.collections.get(f'IfcProject/{element.Decomposes[0].RelatingObject.Name}')
|
||||
elif element.Decomposes[0].RelatingObject.is_a('IfcSpatialStructureElement'):
|
||||
collection = bpy.data.collections.get('{}/{}'.format(
|
||||
element.Decomposes[0].RelatingObject.is_a(),
|
||||
element.Decomposes[0].RelatingObject.Name))
|
||||
else:
|
||||
collection = bpy.data.collections.get(f'IfcRelAggregates/{element.Decomposes[0].id()}')
|
||||
if collection:
|
||||
@@ -658,6 +666,7 @@ class IfcImportSettings:
|
||||
self.should_reset_absolute_coordinates = False
|
||||
self.should_import_curves = False
|
||||
self.should_import_opening_elements = False
|
||||
self.should_import_spaces = False
|
||||
self.should_treat_styled_item_as_material = False
|
||||
self.should_use_cpu_multiprocessing = False
|
||||
self.should_use_legacy = False
|
||||
|
||||
@@ -96,6 +96,7 @@ class ImportIFC(bpy.types.Operator, ImportHelper):
|
||||
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_import_spaces = bpy.context.scene.BIMProperties.import_should_import_spaces
|
||||
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
|
||||
|
||||
@@ -377,6 +377,7 @@ class BIMProperties(PropertyGroup):
|
||||
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_import_spaces: BoolProperty(name="Import Spaces", 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)
|
||||
|
||||
@@ -633,6 +633,8 @@ class BIM_PT_mvd(Panel):
|
||||
row.prop(bim_properties, 'import_should_import_curves')
|
||||
row = layout.row()
|
||||
row.prop(bim_properties, 'import_should_import_opening_elements')
|
||||
row = layout.row()
|
||||
row.prop(bim_properties, 'import_should_import_spaces')
|
||||
|
||||
layout.label(text='Experimental Modes:')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user