Refining of Arch Roof tool

This commit is contained in:
Yorik van Havre 2012-05-18 17:43:57 -03:00 committed by logari81
parent 8b19107792
commit d56e08e47f
4 changed files with 22 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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