diff --git a/src/bonsai/bonsai/bim/module/drawing/operator.py b/src/bonsai/bonsai/bim/module/drawing/operator.py index 29c82656a9..8d3498bce6 100644 --- a/src/bonsai/bonsai/bim/module/drawing/operator.py +++ b/src/bonsai/bonsai/bim/module/drawing/operator.py @@ -1470,6 +1470,9 @@ class CreateDrawing(bpy.types.Operator): classes.add(el.attrib["{http://www.ifcopenshell.org/ns}guid"]) is_closed_polygon = False for path in el.findall("{http://www.w3.org/2000/svg}path"): + # Temporary hack. + if "d" not in path.attrib: + continue for subpath in path.attrib["d"].split("M")[1:]: subpath_co = "M" + subpath.strip(" Z") # Round due to inaccuracies from Blender meshes and bisection diff --git a/src/bonsai/bonsai/tool/drawing.py b/src/bonsai/bonsai/tool/drawing.py index 4b2fb45661..2a339e4cf1 100644 --- a/src/bonsai/bonsai/tool/drawing.py +++ b/src/bonsai/bonsai/tool/drawing.py @@ -2492,6 +2492,11 @@ class Drawing(bonsai.core.tool.Drawing): paths = element_g.findall(f"{SVG}path") for path in paths: + # For some reason `` without "d" attribute can occur too. See #6871. + # It's unclear whether this issue is still present with the updated ifcopenshell core, + # but adding this fix for now. Could be reveted later. + if "d" not in path.attrib: + continue path = path.attrib["d"] if not re.match(MULTI_POLYLINE_PATTERN, path):