From 391a41cbda7518aeefb32a3d856e8fda5e9d7a1e Mon Sep 17 00:00:00 2001 From: tetektoza Date: Thu, 22 May 2025 00:19:43 +0200 Subject: [PATCH] BIM: Add missing IFC attributes for both Pipe and Rebar As the title says - those two tools missed IFC attributes, since they used different path of initialization than other components, so this patch makes sure we initialize those properties properly. --- src/Mod/BIM/ArchPipe.py | 7 ++++++- src/Mod/BIM/ArchRebar.py | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Mod/BIM/ArchPipe.py b/src/Mod/BIM/ArchPipe.py index 067203e094..8071fe8b95 100644 --- a/src/Mod/BIM/ArchPipe.py +++ b/src/Mod/BIM/ArchPipe.py @@ -35,6 +35,7 @@ __url__ = "https://www.freecad.org" import FreeCAD import ArchComponent +import ArchIFC from draftutils import params @@ -101,7 +102,11 @@ class _ArchPipe(ArchComponent.Component): self.setProperties(obj) def onChanged(self, obj, prop): - if prop == "ProfileType": + if prop == "IfcType": + root = ArchIFC.IfcProduct() + root.setupIfcAttributes(obj) + root.setupIfcComplexAttributes(obj) + elif prop == "ProfileType": if obj.ProfileType == "Square": obj.setPropertyStatus("Height", "Hidden") obj.setPropertyStatus("Diameter", "Hidden") diff --git a/src/Mod/BIM/ArchRebar.py b/src/Mod/BIM/ArchRebar.py index 8aa62f0e86..46526f3fb5 100644 --- a/src/Mod/BIM/ArchRebar.py +++ b/src/Mod/BIM/ArchRebar.py @@ -38,6 +38,7 @@ __url__ = "https://www.freecad.org" import FreeCAD import ArchCommands +import ArchIFC import ArchComponent import Draft import DraftVecUtils @@ -210,8 +211,11 @@ class _Rebar(ArchComponent.Component): return [wires,obj.Diameter.Value/2] def onChanged(self,obj,prop): - - if prop == "Host": + if prop == "IfcType": + root = ArchIFC.IfcProduct() + root.setupIfcAttributes(obj) + root.setupIfcComplexAttributes(obj) + elif prop == "Host": if hasattr(obj,"Host"): if obj.Host: # mark host to recompute so it can detect this object