From a413a870a0939cdebc85db7fb5d3766de4fbb8f1 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Sun, 7 Apr 2013 18:29:27 -0300 Subject: [PATCH] 0000947: Arch windows based on fully constrained sketches --- src/Mod/Arch/ArchCommands.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index a210f43af..63b5055b6 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -136,6 +136,12 @@ def removeComponents(objectsList,host=None): elif o.Base.Support.Name == host.Name: FreeCAD.Console.PrintMessage(str(translate("Arch","removing sketch support to avoid cross-referencing"))) o.Base.Support = None + elif o.Base.ExternalGeometry: + for i in range(len(o.Base.ExternalGeometry)): + if o.Base.ExternalGeometry[i][0].Name == host.Name: + o.Base.delExternal(i) + FreeCAD.Console.PrintMessage(str(translate("Arch","removing sketch support to avoid cross-referencing"))) + break host.Subtractions = s else: for o in objectsList: @@ -165,6 +171,26 @@ def removeComponents(objectsList,host=None): a.remove(o) h.Objects = a +def fixWindow(obj): + '''fixWindow(object): Fixes non-DAG problems in windows + by removing supports and external geometry from underlying sketches''' + if Draft.getType(obj) == "Window": + if obj.Base: + if hasattr(obj.Base,"Support"): + if obj.Base.Support: + if isinstance(o.Base.Support,tuple): + if obj.Base.Support[0]: + FreeCAD.Console.PrintMessage(str(translate("Arch","removing sketch support to avoid cross-referencing"))) + obj.Base.Support = None + elif obj.Base.Support: + FreeCAD.Console.PrintMessage(str(translate("Arch","removing sketch support to avoid cross-referencing"))) + obj.Base.Support = None + if hasattr(obj.Base,"ExternalGeometry"): + if obj.Base.ExternalGeometry: + for i in range(len(obj.Base.ExternalGeometry)): + obj.Base.delExternal(0) + FreeCAD.Console.PrintMessage(str(translate("Arch","removing sketch external references to avoid cross-referencing"))) + def copyProperties(obj1,obj2): '''copyProperties(obj1,obj2): Copies properties values from obj1 to obj2, when that property exists in both objects'''