diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index b6065fa04..c9fa5a347 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -260,8 +260,6 @@ class Component: "Other shapes that are appended to this wall") obj.addProperty("App::PropertyLinkList","Subtractions","Base", "Other shapes that are subtracted from this wall") - obj.addProperty("App::PropertyVector","Normal","Base", - "The normal extrusion direction of this wall (keep (0,0,0) for automatic normal)") obj.Proxy = self self.Type = "Component" self.Subvolume = None diff --git a/src/Mod/Arch/ArchRoof.py b/src/Mod/Arch/ArchRoof.py index 62850f243..37d06b58e 100644 --- a/src/Mod/Arch/ArchRoof.py +++ b/src/Mod/Arch/ArchRoof.py @@ -61,13 +61,30 @@ class _CommandRoof: sel = FreeCADGui.Selection.getSelectionEx() if sel: sel = sel[0] + obj = sel.Object if sel.HasSubObjects: if "Face" in sel.SubElementNames[0]: - obj = sel.Object idx = int(sel.SubElementNames[0][4:]) FreeCAD.ActiveDocument.openTransaction("Create Roof") makeRoof(obj,idx) FreeCAD.ActiveDocument.commitTransaction() + FreeCAD.ActiveDocument.recompute() + elif obj.isDerivedFrom("Part::Feature"): + if len(obj.Shape.Faces) == 1: + FreeCAD.ActiveDocument.openTransaction("Create Roof") + makeRoof(obj,1) + FreeCAD.ActiveDocument.commitTransaction() + FreeCAD.ActiveDocument.recompute() + elif obj.isDerivedFrom("Part::Feature"): + if len(obj.Shape.Faces) == 1: + FreeCAD.ActiveDocument.openTransaction("Create Roof") + makeRoof(obj,1) + FreeCAD.ActiveDocument.commitTransaction() + FreeCAD.ActiveDocument.recompute() + else: + FreeCAD.Console.PrintMessage("Unable to create a roof") + else: + FreeCAD.Console.PrintMessage("No object selected") class _Roof(ArchComponent.Component): "The Roof object" @@ -77,8 +94,6 @@ class _Roof(ArchComponent.Component): "The angle of this roof") obj.addProperty("App::PropertyInteger","Face","Base", "The face number of the base object used to build this roof") - obj.addProperty("App::PropertyLink","Base","Base", - "The base object this roof is built on") self.Type = "Structure" def execute(self,obj): diff --git a/src/Mod/Arch/ArchStructure.py b/src/Mod/Arch/ArchStructure.py index 63d7b668c..cd87115eb 100644 --- a/src/Mod/Arch/ArchStructure.py +++ b/src/Mod/Arch/ArchStructure.py @@ -86,6 +86,8 @@ class _Structure(ArchComponent.Component): "The height or extrusion depth of this element. Keep 0 for automatic") obj.addProperty("App::PropertyLinkList","Axes","Base", "Axes systems this structure is built on") + obj.addProperty("App::PropertyVector","Normal","Base", + "The normal extrusion direction of this object (keep (0,0,0) for automatic normal)") self.Type = "Structure" def execute(self,obj): diff --git a/src/Mod/Arch/ArchWall.py b/src/Mod/Arch/ArchWall.py index 108edabfc..36c33e7a8 100644 --- a/src/Mod/Arch/ArchWall.py +++ b/src/Mod/Arch/ArchWall.py @@ -251,6 +251,8 @@ class _Wall(ArchComponent.Component): "The height of this wall. Keep 0 for automatic. Not used if this wall is based on a solid") obj.addProperty("App::PropertyEnumeration","Align","Base", "The alignment of this wall on its base object, if applicable") + obj.addProperty("App::PropertyVector","Normal","Base", + "The normal extrusion direction of this object (keep (0,0,0) for automatic normal)") obj.Align = ['Left','Right','Center'] self.Type = "Wall" obj.Width = 0.1