From 793c1c8ec603107169b4e3bac95e4a452ab736b2 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 6 Jun 2020 11:55:22 +1000 Subject: [PATCH] Enable curve imports by default, so rebar, profiles, are imported without user confusion. See #771 and #865. --- src/ifcblenderexport/blenderbim/bim/import_ifc.py | 7 +++++++ src/ifcblenderexport/blenderbim/bim/prop.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ifcblenderexport/blenderbim/bim/import_ifc.py b/src/ifcblenderexport/blenderbim/bim/import_ifc.py index e702a77c75..79570f9e84 100644 --- a/src/ifcblenderexport/blenderbim/bim/import_ifc.py +++ b/src/ifcblenderexport/blenderbim/bim/import_ifc.py @@ -264,6 +264,7 @@ class IfcImporter(): self.create_aggregates() if self.ifc_import_settings.should_import_opening_elements: self.create_openings_collection() + self.purge_non_body_representations() self.parse_native_products() self.filter_ifc() self.patch_ifc() @@ -324,6 +325,12 @@ class IfcImporter(): or abs(point.Coordinates[1]) > 1000000 \ or abs(point.Coordinates[2]) > 1000000 + def purge_non_body_representations(self): + # See https://github.com/IfcOpenShell/IfcOpenShell/issues/771 + for element in self.file.by_type('IfcShapeRepresentation'): + if element.RepresentationIdentifier != 'Body': + self.file.remove(element) + def parse_native_products(self): # TODO: simple code for now as we only treat rebar specially for element in self.file.by_type('IfcReinforcingBar'): diff --git a/src/ifcblenderexport/blenderbim/bim/prop.py b/src/ifcblenderexport/blenderbim/bim/prop.py index b061fd0eee..68bdcea5ef 100644 --- a/src/ifcblenderexport/blenderbim/bim/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/prop.py @@ -890,7 +890,7 @@ class BIMProperties(PropertyGroup): import_should_ignore_site_coordinates: BoolProperty(name="Import Ignoring Site Coordinates", default=False) 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_curves: BoolProperty(name="Import Curves", default=True) 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)