def Activated(self): from PathScripts.PathUtils import horizontalEdgeLoop from PathScripts.PathUtils import horizontalFaceLoop sel = FreeCADGui.Selection.getSelectionEx()[0] obj = sel.Object edge1 = sel.SubObjects[0] if 'Face' in sel.SubElementNames[0]: loop = horizontalFaceLoop(sel.Object, sel.SubObjects[0], sel.SubElementNames) if loop: FreeCADGui.Selection.clearSelection() FreeCADGui.Selection.addSelection(sel.Object, loop) loopwire = [] elif len(sel.SubObjects) == 1: loopwire = horizontalEdgeLoop(obj, edge1) else: edge2 = sel.SubObjects[1] loopwire = loopdetect(obj, edge1, edge2) if loopwire: FreeCADGui.Selection.clearSelection() elist = obj.Shape.Edges for e in elist: for i in loopwire.Edges: if e.hashCode() == i.hashCode(): FreeCADGui.Selection.addSelection(obj, "Edge" + str(elist.index(e) + 1)) elif FreeCAD.GuiUp: QtGui.QMessageBox.information(None, QtCore.QT_TRANSLATE_NOOP('Path_SelectLoop', 'Feature Completion'), QtCore.QT_TRANSLATE_NOOP('Path_SelectLoop', 'Closed loop detection failed.'))
def Activated(self): from PathScripts.PathUtils import loopdetect from PathScripts.PathUtils import horizontalEdgeLoop from PathScripts.PathUtils import horizontalFaceLoop sel = FreeCADGui.Selection.getSelectionEx()[0] obj = sel.Object edge1 = sel.SubObjects[0] if 'Face' in sel.SubElementNames[0]: loop = horizontalFaceLoop(sel.Object, sel.SubObjects[0], sel.SubElementNames) if loop: FreeCADGui.Selection.clearSelection() FreeCADGui.Selection.addSelection(sel.Object, loop) loopwire = [] elif len(sel.SubObjects) == 1: loopwire = horizontalEdgeLoop(obj, edge1) else: edge2 = sel.SubObjects[1] loopwire = loopdetect(obj, edge1, edge2) if loopwire: FreeCADGui.Selection.clearSelection() elist = obj.Shape.Edges for e in elist: for i in loopwire.Edges: if e.hashCode() == i.hashCode(): FreeCADGui.Selection.addSelection(obj, "Edge"+str(elist.index(e)+1))
def Activated(self): sel = FreeCADGui.Selection.getSelectionEx()[0] obj = sel.Object edge1 = sel.SubObjects[0] if 'Face' in sel.SubElementNames[0]: loop = horizontalFaceLoop(sel.Object, sel.SubObjects[0], sel.SubElementNames) if loop: FreeCADGui.Selection.clearSelection() FreeCADGui.Selection.addSelection(sel.Object, loop) loopwire = [] elif len(sel.SubObjects) == 1: loopwire = horizontalEdgeLoop(obj, edge1) else: edge2 = sel.SubObjects[1] loopwire = loopdetect(obj, edge1, edge2) if loopwire: FreeCADGui.Selection.clearSelection() elist = obj.Shape.Edges for e in elist: for i in loopwire.Edges: if e.hashCode() == i.hashCode(): FreeCADGui.Selection.addSelection( obj, "Edge" + str(elist.index(e) + 1))
def Activated(self): sel = FreeCADGui.Selection.getSelectionEx()[0] obj = sel.Object edge1 = sel.SubObjects[0] edge2 = sel.SubObjects[1] loopwire = loopdetect(obj, edge1, edge2) if loopwire is not None: FreeCADGui.Selection.clearSelection() elist = obj.Shape.Edges for e in elist: for i in loopwire.Edges: if e.hashCode() == i.hashCode(): FreeCADGui.Selection.addSelection(obj, "Edge"+str(elist.index(e)+1))
def Activated(self): sel = FreeCADGui.Selection.getSelectionEx()[0] obj = sel.Object edge1 = sel.SubObjects[0] edge2 = sel.SubObjects[1] loopwire = loopdetect(obj, edge1, edge2) if loopwire is not None: FreeCADGui.Selection.clearSelection() elist = obj.Shape.Edges for e in elist: for i in loopwire.Edges: if e.hashCode() == i.hashCode(): FreeCADGui.Selection.addSelection(obj, "Edge"+str(elist.index(e)+1))