Refining of Arch Roof tool
This commit is contained in:
parent
1c1dbf0b2e
commit
82265b4ea9
|
@ -260,8 +260,6 @@ class Component:
|
||||||
"Other shapes that are appended to this wall")
|
"Other shapes that are appended to this wall")
|
||||||
obj.addProperty("App::PropertyLinkList","Subtractions","Base",
|
obj.addProperty("App::PropertyLinkList","Subtractions","Base",
|
||||||
"Other shapes that are subtracted from this wall")
|
"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
|
obj.Proxy = self
|
||||||
self.Type = "Component"
|
self.Type = "Component"
|
||||||
self.Subvolume = None
|
self.Subvolume = None
|
||||||
|
|
|
@ -61,13 +61,30 @@ class _CommandRoof:
|
||||||
sel = FreeCADGui.Selection.getSelectionEx()
|
sel = FreeCADGui.Selection.getSelectionEx()
|
||||||
if sel:
|
if sel:
|
||||||
sel = sel[0]
|
sel = sel[0]
|
||||||
|
obj = sel.Object
|
||||||
if sel.HasSubObjects:
|
if sel.HasSubObjects:
|
||||||
if "Face" in sel.SubElementNames[0]:
|
if "Face" in sel.SubElementNames[0]:
|
||||||
obj = sel.Object
|
|
||||||
idx = int(sel.SubElementNames[0][4:])
|
idx = int(sel.SubElementNames[0][4:])
|
||||||
FreeCAD.ActiveDocument.openTransaction("Create Roof")
|
FreeCAD.ActiveDocument.openTransaction("Create Roof")
|
||||||
makeRoof(obj,idx)
|
makeRoof(obj,idx)
|
||||||
FreeCAD.ActiveDocument.commitTransaction()
|
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):
|
class _Roof(ArchComponent.Component):
|
||||||
"The Roof object"
|
"The Roof object"
|
||||||
|
@ -77,8 +94,6 @@ class _Roof(ArchComponent.Component):
|
||||||
"The angle of this roof")
|
"The angle of this roof")
|
||||||
obj.addProperty("App::PropertyInteger","Face","Base",
|
obj.addProperty("App::PropertyInteger","Face","Base",
|
||||||
"The face number of the base object used to build this roof")
|
"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"
|
self.Type = "Structure"
|
||||||
|
|
||||||
def execute(self,obj):
|
def execute(self,obj):
|
||||||
|
|
|
@ -86,6 +86,8 @@ class _Structure(ArchComponent.Component):
|
||||||
"The height or extrusion depth of this element. Keep 0 for automatic")
|
"The height or extrusion depth of this element. Keep 0 for automatic")
|
||||||
obj.addProperty("App::PropertyLinkList","Axes","Base",
|
obj.addProperty("App::PropertyLinkList","Axes","Base",
|
||||||
"Axes systems this structure is built on")
|
"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"
|
self.Type = "Structure"
|
||||||
|
|
||||||
def execute(self,obj):
|
def execute(self,obj):
|
||||||
|
|
|
@ -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")
|
"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",
|
obj.addProperty("App::PropertyEnumeration","Align","Base",
|
||||||
"The alignment of this wall on its base object, if applicable")
|
"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']
|
obj.Align = ['Left','Right','Center']
|
||||||
self.Type = "Wall"
|
self.Type = "Wall"
|
||||||
obj.Width = 0.1
|
obj.Width = 0.1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user