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.
This commit is contained in:
tetektoza
2025-05-22 00:19:43 +02:00
committed by Yorik van Havre
parent 13924c0469
commit 8f8ed52764
2 changed files with 12 additions and 3 deletions

View File

@@ -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")

View File

@@ -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