Arch: Windows are now autosubtracted from support walls on creation
This commit is contained in:
parent
8d19906db4
commit
495c401654
|
@ -88,10 +88,26 @@ class _CommandWindow:
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
sel = FreeCADGui.Selection.getSelection()
|
sel = FreeCADGui.Selection.getSelection()
|
||||||
|
if sel:
|
||||||
|
if Draft.getType(sel[0]) == "Wall":
|
||||||
|
FreeCADGui.activateWorkbench("SketcherWorkbench")
|
||||||
|
FreeCADGui.runCommand("Sketcher_NewSketch")
|
||||||
|
else:
|
||||||
FreeCAD.ActiveDocument.openTransaction(str(translate("Arch","Create Window")))
|
FreeCAD.ActiveDocument.openTransaction(str(translate("Arch","Create Window")))
|
||||||
FreeCADGui.doCommand("import Arch")
|
FreeCADGui.doCommand("import Arch")
|
||||||
for obj in sel:
|
for obj in sel:
|
||||||
FreeCADGui.doCommand("Arch.makeWindow(FreeCAD.ActiveDocument."+obj.Name+")")
|
FreeCADGui.doCommand("Arch.makeWindow(FreeCAD.ActiveDocument."+obj.Name+")")
|
||||||
|
if hasattr(obj,"Support"):
|
||||||
|
if obj.Support:
|
||||||
|
if isinstance(obj.Support,tuple):
|
||||||
|
s = obj.Support[0]
|
||||||
|
else:
|
||||||
|
s = obj.Support
|
||||||
|
w = FreeCAD.ActiveDocument.Objects[-1] # last created object
|
||||||
|
FreeCADGui.doCommand("Arch.removeComponents(FreeCAD.ActiveDocument."+w.Name+",host=FreeCAD.ActiveDocument."+s.Name+")")
|
||||||
|
elif Draft.isClone(w,"Window"):
|
||||||
|
if w.Objects[0].Inlist:
|
||||||
|
FreeCADGui.doCommand("Arch.removeComponents(FreeCAD.ActiveDocument."+w.Name+",host=FreeCAD.ActiveDocument."+w.Objects[0].Inlist[0].Name+")")
|
||||||
FreeCAD.ActiveDocument.commitTransaction()
|
FreeCAD.ActiveDocument.commitTransaction()
|
||||||
|
|
||||||
class _Window(ArchComponent.Component):
|
class _Window(ArchComponent.Component):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user