From b118400cc6b93064a28b1ed35d704c23da4498d3 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 30 Oct 2021 22:10:37 +1100 Subject: [PATCH] Invalid annotation contexts coming from Revit are now accepted --- src/blenderbim/blenderbim/bim/import_ifc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/import_ifc.py b/src/blenderbim/blenderbim/bim/import_ifc.py index 8df3053d74..1bc1536d52 100644 --- a/src/blenderbim/blenderbim/bim/import_ifc.py +++ b/src/blenderbim/blenderbim/bim/import_ifc.py @@ -280,8 +280,12 @@ class IfcImporter: ] if self.body_contexts: self.settings.set_context_ids(self.body_contexts) + # Annotation is to accommodate broken Revit files + # See https://github.com/Autodesk/revit-ifc/issues/187 self.plan_contexts = [ - c.id() for c in self.file.by_type("IfcGeometricRepresentationContext") if c.ContextType == "Plan" + c.id() + for c in self.file.by_type("IfcGeometricRepresentationContext") + if c.ContextType in ["Plan", "Annotation"] ] if self.plan_contexts: self.settings_2d.set_context_ids(self.plan_contexts)