diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index de389b215..ad67904fd 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -994,9 +994,9 @@ PyMethodDef SelectionSingleton::Methods[] = { "removeObserver(Object) -- Uninstall an observer\n"}, {"addSelectionGate", (PyCFunction) SelectionSingleton::sAddSelectionGate, 1, "addSelectionGate(String) -- activate the selection gate.\n" - "The selection gate will prohibit all selections which do not match the\n" + "The selection gate will prohibit all selections which do not match\n" "the given selection filter string. Examples strings are:\n" - "'SELECT Part::Feature SUB Edge',\n" + "'SELECT Part::Feature SUBELEMENT Edge',\n" "'SELECT Robot::RobotObject'\n"}, {"removeSelectionGate", (PyCFunction) SelectionSingleton::sRemoveSelectionGate, 1, "removeSelectionGate() -- remove the active slection gate\n"}, 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''' diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index d2dc22e80..3352f0512 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -976,10 +976,13 @@ class DraftToolBar: self.toggleradius(-1) elif txt.endsWith("x"): self.constrain("x") + self.displayPoint() elif txt.endsWith("y"): self.constrain("y") + self.displayPoint() elif txt.endsWith("z"): - self.constrain("z") + self.constrain("z") + self.displayPoint() elif txt.endsWith("c"): if self.closeButton.isVisible(): self.closeLine() @@ -1033,32 +1036,37 @@ class DraftToolBar: self.textline -= 1 self.textValue.setText(self.textbuffer[self.textline]) - def displayPoint(self, point, last=None, plane=None, mask=None): + def displayPoint(self, point=None, last=None, plane=None, mask=None): "this function displays the passed coords in the x, y, and z widgets" if (not self.taskmode) or self.isTaskOn: # get coords to display - dp = point - if self.relativeMode and (last != None): - if plane: - dp = plane.getLocalRot(FreeCAD.Vector(point.x-last.x, point.y-last.y, point.z-last.z)) - else: - dp = FreeCAD.Vector(point.x-last.x, point.y-last.y, point.z-last.z) + dp = None + if point: + dp = point + if self.relativeMode and (last != None): + if plane: + dp = plane.getLocalRot(FreeCAD.Vector(point.x-last.x, point.y-last.y, point.z-last.z)) + else: + dp = FreeCAD.Vector(point.x-last.x, point.y-last.y, point.z-last.z) # set widgets if self.mask in ['y','z']: self.xValue.setText("0.00") else: - self.xValue.setText("%.2f" % dp.x) + if dp: + self.xValue.setText("%.2f" % dp.x) if self.mask in ['x','z']: self.yValue.setText("0.00") else: - self.yValue.setText("%.2f" % dp.y) + if dp: + self.yValue.setText("%.2f" % dp.y) if self.mask in ['x','y']: self.zValue.setText("0.00") else: - self.zValue.setText("%.2f" % dp.z) + if dp: + self.zValue.setText("%.2f" % dp.z) # set masks if (mask == "x") or (self.mask == "x"): diff --git a/src/Mod/Draft/DraftTools.py b/src/Mod/Draft/DraftTools.py index 8cbe386ab..fbff806a5 100644 --- a/src/Mod/Draft/DraftTools.py +++ b/src/Mod/Draft/DraftTools.py @@ -2984,8 +2984,8 @@ class Edit(Modifier): elif arg["Key"] == "c": self.finish(closed=True) elif arg["Type"] == "SoLocation2Event": #mouse movement detection + self.point,ctrlPoint,info = getPoint(self,arg) if self.editing != None: - self.point,ctrlPoint,info = getPoint(self,arg) self.trackers[self.editing].set(self.point) self.update(self.trackers[self.editing].get()) elif arg["Type"] == "SoMouseButtonEvent": @@ -3000,8 +3000,9 @@ class Edit(Modifier): self.pos = arg["Position"] self.addPoint(self.point) elif self.ui.delButton.isChecked(): - if 'EditNode' in sel.SubElementNames[0]: - self.delPoint(int(sel.SubElementNames[0][8:])) + if sel.SubElementNames: + if 'EditNode' in sel.SubElementNames[0]: + self.delPoint(int(sel.SubElementNames[0][8:])) elif 'EditNode' in sel.SubElementNames[0]: self.ui.pointUi() self.ui.isRelative.show()