From db5fff6cccb3ce2fb02a9614369e620bae75c3d3 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Sat, 24 Jan 2026 20:43:42 +0100 Subject: [PATCH] BIM: fix BuildingPart issues with Arch_Reference --- src/Mod/BIM/ArchReference.py | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/Mod/BIM/ArchReference.py b/src/Mod/BIM/ArchReference.py index 3568bd0620..1bb19b7195 100644 --- a/src/Mod/BIM/ArchReference.py +++ b/src/Mod/BIM/ArchReference.py @@ -171,6 +171,10 @@ class ArchReference: FreeCAD.Console.PrintError(t + "\n") else: for part in self.parts.values(): + if part[3]: + # Do not include BuildingParts as their + # shape is just a copy of their group: + continue f = zdoc.open(part[1]) shapedata = f.read() f.close() @@ -385,6 +389,7 @@ class ArchReference: label = None part = None materials = {} + is_buildingpart = False writemode = False for line in docf: line = line.decode("utf8") @@ -392,6 +397,8 @@ class ArchReference: n = re.findall(r"name=\"(.*?)\"", line) if n: name = n[0] + elif 'class="BuildingPart"' in line: + is_buildingpart = True elif '" in line: if name and label and part: - parts[name] = [label, part, materials] + parts[name] = [label, part, materials, is_buildingpart] name = None label = None part = None materials = {} + is_buildingpart = False writemode = False return parts @@ -452,7 +460,11 @@ class ArchReference: return [] totalcolors = [] - parts = [obj.Part] if obj.Part else self.parts.keys() + if obj.Part: + parts = [obj.Part] + else: + # Do not include BuildingParts as their shape is just a copy of their group: + parts = [key for key, val in self.parts.items() if not val[3]] lenparts = len(parts) for i, part in enumerate(parts): lenfaces = len(self.shapes[i].Faces) @@ -471,7 +483,6 @@ class ArchReference: zdoc = zipfile.ZipFile(filename) if not "GuiDocument.xml" in zdoc.namelist(): return [] - colors = [] colorfile = None with zdoc.open("GuiDocument.xml") as docf: writemode1 = False @@ -481,26 +492,27 @@ class ArchReference: line = line.decode("utf8") if ('