def askGoToLine(self): line, ok = QInputDialog.getInt( self, self.trUtf8(b'Goto line'), self.trUtf8(b'Line number:'), self.editor.textCursor().blockNumber(), 1, self.editor.document().blockCount()) if ok: self.goToLine(line)
def Activated(self): if hasattr(FreeCAD, 'DraftWorkingPlane') and hasattr( FreeCADGui, 'Snapper'): import uCmd s = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft" ).GetInt("gridSize") sc = [float(x * s) for x in [1, 1, .2]] arrow = uCmd.arrow(FreeCAD.DraftWorkingPlane.getPlacement(), scale=sc, offset=s) from PySide.QtGui import QInputDialog as qid offset = qid.getInt(None, 'Offset Work Plane', 'Offset: ') if offset[1] > 0: uCmd.offsetWP(offset[0]) #FreeCADGui.ActiveDocument.ActiveView.getSceneGraph().removeChild(arrow.node) arrow.closeArrow()