diff --git a/src/ifcblenderexport/Makefile b/src/ifcblenderexport/Makefile index 197ddb8e4d..151a8f7bf0 100644 --- a/src/ifcblenderexport/Makefile +++ b/src/ifcblenderexport/Makefile @@ -26,7 +26,7 @@ endif cp -r blenderbim/* dist/blenderbim/ # Provides IfcOpenShell Python functionality - cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcblender-python-37-v0.6.0-ca6adff-$(PLATFORM)64.zip + cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcblender-python-37-v0.6.0-b08346c-$(PLATFORM)64.zip cd dist/working && unzip ifcblender* cp -r dist/working/io_import_scene_ifc/ifcopenshell dist/blenderbim/libs/site/packages/ # See bug #812 diff --git a/src/ifcblenderexport/blenderbim/bim/import_ifc.py b/src/ifcblenderexport/blenderbim/bim/import_ifc.py index 1871d6b945..8c83454319 100644 --- a/src/ifcblenderexport/blenderbim/bim/import_ifc.py +++ b/src/ifcblenderexport/blenderbim/bim/import_ifc.py @@ -228,11 +228,14 @@ class MaterialCreator: if profile.Material.Name not in self.materials: self.create_new_single(profile.Material) new.material = self.materials[profile.Material.Name] - new.profile = profile.Profile.is_a() - for i, attribute in enumerate(profile.Profile): - newa = new.profile_attributes.add() - newa.name = profile.Profile.attribute_name(i) - newa.string_value = str(attribute) + try: + new.profile = profile.Profile.is_a() + for i, attribute in enumerate(profile.Profile): + newa = new.profile_attributes.add() + newa.name = profile.Profile.attribute_name(i) + newa.string_value = str(attribute) + except: + pass # TODO: currently, only parametric profile sets are supported new.priority = profile.Priority or 0 new.category = profile.Category or "" @@ -1352,6 +1355,8 @@ class IfcImporter: for obj in bpy.context.selectable_objects: global_id = obj.BIMObjectProperties.attributes.get("GlobalId") if global_id and global_id.string_value in guids: + if not obj.data or not hasattr(obj.data, "BIMMeshProperties"): + continue obj.data.BIMMeshProperties.presentation_layer_index = layer_index obj.hide_set(not layer.layer_on) diff --git a/src/ifcblenderexport/blenderbim/bim/prop.py b/src/ifcblenderexport/blenderbim/bim/prop.py index 00633a009a..019cba8f17 100644 --- a/src/ifcblenderexport/blenderbim/bim/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/prop.py @@ -479,6 +479,8 @@ def getApplicableMaterialAttributes(self, context): def refreshProfileAttributes(self, context): + if not context.active_object: + return props = context.active_object.BIMObjectProperties profile = props.material_set.material_profiles[props.material_set.active_material_profile_index] while len(profile.profile_attributes) > 0: