diff --git a/src/Mod/Arch/Arch.py b/src/Mod/Arch/Arch.py index 387ebf0043..095fa62bcd 100644 --- a/src/Mod/Arch/Arch.py +++ b/src/Mod/Arch/Arch.py @@ -61,3 +61,4 @@ from ArchCutPlane import * from ArchServer import * from ArchMaterial import * from ArchSchedule import * +from ArchPrecast import * diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index 52208f99c4..c0e2e0887c 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -352,6 +352,8 @@ class Component: def getAxis(self,obj): "Returns an open wire which is the axis of this component, if applicable" + if Draft.getType(obj) == "Precast": + return None if obj.Base: if obj.Base.isDerivedFrom("Part::Feature"): if obj.Base.Shape: @@ -378,6 +380,8 @@ class Component: def getProfiles(self,obj,noplacement=False): "Returns the base profile(s) of this component, if applicable" wires = [] + if Draft.getType(obj) == "Precast": + return wires n,l,w,h = self.getDefaultValues(obj) if obj.Base: if obj.Base.isDerivedFrom("Part::Extrusion"): @@ -477,6 +481,8 @@ class Component: def getExtrusionVector(self,obj,noplacement=False): "Returns an extrusion vector of this component, if applicable" n,l,w,h = self.getDefaultValues(obj) + if Draft.getType(obj) == "Precast": + return FreeCAD.Vector() if obj.Base: if obj.Base.isDerivedFrom("Part::Extrusion"): return FreeCAD.Vector(obj.Base.Dir) diff --git a/src/Mod/Arch/ArchPrecast.py b/src/Mod/Arch/ArchPrecast.py index b3bc17e76a..af0a118d61 100644 --- a/src/Mod/Arch/ArchPrecast.py +++ b/src/Mod/Arch/ArchPrecast.py @@ -44,7 +44,14 @@ class _Precast(ArchComponent.Component): obj.addProperty("App::PropertyDistance","Height","Arch","The height of this element") obj.addProperty("App::PropertyLinkList","Armatures","Arch","Armatures contained in this element") obj.addProperty("App::PropertyVectorList","Nodes","Arch","The structural nodes of this element") - self.Type = "Structure" + self.Type = "Precast" + obj.Role = ["Beam","Column","Panel","Slab"] + + def getProfile(self,obj,noplacement=True): + return [] + + def getExtrusionVector(self,obj,noplacement=True): + return FreeCAD.Vector() class _PrecastBeam(_Precast): @@ -1090,6 +1097,9 @@ def makePrecast(precasttype,length=0,width=0,height=0,slabtype="",chamfer=0,dent obj.Height = height obj.Chamfer = chamfer obj.BeamBase = base + else: + obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Precast") + _Precast(obj) if FreeCAD.GuiUp: _ViewProviderPrecast(obj.ViewObject) return obj diff --git a/src/Mod/Arch/Resources/ui/preferences-ifc.ui b/src/Mod/Arch/Resources/ui/preferences-ifc.ui index 798c16710c..f4b10af60c 100644 --- a/src/Mod/Arch/Resources/ui/preferences-ifc.ui +++ b/src/Mod/Arch/Resources/ui/preferences-ifc.ui @@ -7,7 +7,7 @@ 0 0 456 - 608 + 637 @@ -59,6 +59,26 @@ + + + + + + Create clones when objects have shared geometry + + + true + + + ifcCreateClones + + + Mod/Arch + + + + + @@ -268,26 +288,6 @@ - - - - - - Create clones when objects have shared geometry - - - true - - - ifcCreateClones - - - Mod/Arch - - - - - diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index c7a4becd6a..d29a7cb92c 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -1077,7 +1077,7 @@ def export(exportList,filename): if (not ifcprop) and hasattr(obj,"IfcAttributes"): if obj.IfcAttributes: ifcprop = True - if DEBUG : print(" adding ifc attributes") + #if DEBUG : print(" adding ifc attributes") props = [] for key in obj.IfcAttributes: if not (key in ["IfcUID","FlagForceBrep"]):