Macro CartoucheFC Full

From FreeCAD Documentation
Revision as of 12:34, 15 October 2016 by FuzzyBot (talk | contribs) (Importing a new version from external source)

File:Text-x-python Macro_CartoucheFC_Full

Description
This macro is a complete application, it allows to fill the cartridge of the drawing sheet with full editabletext.

Macro version: 5 (08/08/2014)
Author: Mario52
Author
Mario52
Download
None
Links
Macro Version
5 (08/08/2014)
Date last modified
None
FreeCAD Version(s)
None
Default shortcut
None
See also
None

This macro is a complete application, it allows to fill simply all the fields of the cartridge

Choice in the page Misc_templates_Full

Here the order of filling in the line FreeCAD texteditable. The date and time fields are separated by a "space negative space" " - " and constitute a single line textedit.

CartoucheFC_Full

Use

PS: Some characters such as & $ are not accepted (and possibly other special characters).

If you have any questions or want to add a function, you can address you on the french forum Remplir cartouche

  • The window remains above other Windows, thereby controlling the cartridge without leaving the program.
  • Copy the code into a file named Macro_CartoucheFC_Full.FCMacro and place it in your usual macros directory.
  • After you have created your drawing sheet using the Drawing of FreeCAD module, run the macro Macro_CartoucheFC_Full.
  • At the opening, the program will register in memory all data already present in the cartridge of the sheet (if they are filled), all these data will be automatically returned to using the button Memo and kept in memory until the closure of the programme.
  • Date button D. and time H. displayed the date and time of the system.
  • The date format depends on the selected symbol EU or US which determines the regional format. Change does not happen automatically (for the case or you have entered a date manually) you must again click buttons dates if you change the symbol (check before printing).
  • Button Symbole EU or US change the meaning of the symbol of projection "Select your Symbol" is displayed by default, and then the active symbol appears. Click on the button and check the leaf symbol, click a second time to modify the symbol.
  • The choice of this symbol, affects the date format EU = dd/MM/yyyy and US = MM/dd/yyyy.
  • Attention: this command does not pass through the button Apply and immediately changes the symbol to each presses on the key, always check if you have the appropriate symbol on your worksheet.
  • Button Clean Clears all fields in the cartridge. You can revert to the original data using the button Memo.
  • Button Apply saves all fields of the cartridge in the sheet. You can revert to the original data using the button Memo (except for the regional symbol that works in independent and is effective immediately).

Code

Macro_CartoucheFC_Full.FCMacro

Macro_CartoucheFC_Full.FCMacro

# -*- coding: utf-8 -*-
"""
***************************************************************************
*   Copyright (c) 2014 2016  <mario52>                                    *
*                                                                         *
*   This file is a supplement to the FreeCAD CAx development system.      *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU Lesser General Public License (LGPL)    *
*   as published by the Free Software Foundation; either version 2 of     *
*   the License, or (at your option) any later version.                   *
*   for detail see the LICENCE text file.                                 *
*                                                                         *
*   This software is distributed in the hope that it will be useful,      *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU Library General Public License for more details.                  *
*                                                                         *
*   You should have received a copy of the GNU Library General Public     *
*   License along with this macro; if not, write to the Free Software     *
*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
*   USA                                                                   *
***************************************************************************
*           WARNING! All changes in this file will be lost and            *  
*                  may cause malfunction of the program                   *
***************************************************************************
"""
#OS: Windows 10
#Word size of OS: 64-bit
#Word size of FreeCAD: 64-bit
#Version: 0.17.8539 (Git)
#Build type: Release
#Branch: master
#Hash: 958686d7b9e94caf0c0558cffc7bbf4f03ce8f21
#Python version: 2.7.8
#Qt version: 4.8.7
#Coin version: 4.0.0a
#OCC version: 7.0.0

__title__   = "Macro_CartoucheFC_Full"
__author__  = "Mario52"
__url__     = "http://www.freecadweb.org/index-fr.html"
__Wiki__    = "http://www.freecadweb.org/wiki/index.php?title=Macro_CartoucheFC_Full"
__version__ = "00.06"
__date__    = "13/10/2016"

__Requires__ = ("all version and freecad 0.17 for use the shape Symbol" +
" DESIGNED_BY, CREATION_DATE, CHECKED_BY, CHECK_DATE, SIZE, SCALE, WEIGHT, DRAWING_NUMBER, SHEET, " +
" TITLE, DESCRIPTION, COMPANY, COPYRIGHT, Note_A, Note_B, Note_C, Note_D, Note_E, Note_F, Note_G, Note_H, Note_I" )
__Template__ = " A3_Landscape_xx_FULL.svg, A3_Portrait_xx_FULL, A4_Landscape_xx_FULL.svg, A4_Portrait_xx_FULL"

try:
    import PyQt4
    from PyQt4 import QtCore, QtGui
except Exception:
    import PySide
    from PySide import QtCore, QtGui

import Draft, Part, FreeCAD, math, PartGui, FreeCADGui
from math import sqrt, pi, sin, cos, asin
from FreeCAD import Base

def utf8(unio):
    return unicode(unio).encode('UTF8')

global path
#path = FreeCAD.ConfigGet("AppHomePath")
path = FreeCAD.ConfigGet("UserAppData")

global PageActive     ;PageActive  = "Page"
global DESIGNED_BY    ;DESIGNED_BY = ""     # lineEdit01 DESIGNED_BY
global CREATION_DATE  ;CREATION_DATE = ""   # lineEdit02 CREATION_DATE date
global CREA_DATE      ;CREA_DATE = ""       # lineEdit02h date
global CREA_TIME      ;CREA_TIME = ""       # lineEdit02h heure
global CHECKED_BY     ;CHECKED_BY = ""      # lineEdit03
global CHECK_DATE     ;CHECK_DATE = ""      # lineEdit04 date
global CHEC_DATE      ;CHEC_DATE = ""       # lineEdit04 date
global CHEC_TIME      ;CHEC_TIME = ""       # lineEdit04h heure
global SIZE           ;SIZE = ""            # lineEdit05
global SCALE          ;SCALE =  ""          # lineEdit06
global WEIGHT         ;WEIGHT =  ""         # lineEdit07
global DRAWING_NUMBER ;DRAWING_NUMBER =  "" # lineEdit08
global SHEET          ;SHEET =  ""          # lineEdit09
global TITLE          ;TITLE =  ""          # textEdit_01
global DESCRIPTION    ;DESCRIPTION =  ""    # textEdit_02
global COMPANY        ;COMPANY = ""         # textEdit_02b
global COPYRIGHT      ; COPYRIGHT = ""      # lineEdit_20
global Note_A         ; Note_A = ""         # lineEdit_10
global Note_B         ; Note_B = ""         # lineEdit_11
global Note_C         ; Note_C = ""         # lineEdit_12
global Note_D         ; Note_D = ""         # lineEdit_13
global Note_E         ; Note_E = ""         # lineEdit_14
global Note_F         ; Note_F = ""         # lineEdit_15
global Note_G         ; Note_G = ""         # lineEdit_16
global Note_H         ; Note_H = ""         # lineEdit_17
global Note_I         ; Note_I = ""         # lineEdit_18
global SymbolSwitch   ; SymbolSwitch = 0    #
global ui             ; ui     = ""

def heure():
    return QtCore.QTime().currentTime().toString('hh:mm:ss')
def dateEu():
    return QtCore.QDate().currentDate().toString('dd/MM/yyyy') # forme euro
def dateUK():
    return QtCore.QDate().currentDate().toString('yyyy/MM/dd') # forme UK
def dateUs():
    return QtCore.QDate().currentDate().toString('MM/dd/yyyy') # forme US
def dateComp():
    return QtCore.QDate().currentDate().toString('dddd d MMMM yyyy') # Retourne "dimanche 20 Juillet 77"

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    def _fromUtf8(s):
        return s
try:
    _encoding = QtGui.QApplication.UnicodeUTF8
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)

def errorDialog(msg):
    diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u"Error Message",msg)
    try:
        diag.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # cette fonction met la fenêtre en avant
    except Exception:
        diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # cette fonction met la fenêtre en avant
    diag.exec_()

def symbol_EU(depx, depy, scale):    #symbol_EU =O
    try:
        App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_US")
    except:
        None
    try:
        App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_EU")
    except:
        None
    try:
        App.getDocument(App.ActiveDocument.Name).removeObject("SymbolUS")
    except:
        None
    try:
        App.getDocument(App.ActiveDocument.Name).removeObject("SymbolEU")
    except:
        None
    App.activeDocument().addObject('Sketcher::SketchObject','Symbol_EU')
    App.activeDocument().Symbol_EU.Placement = App.Placement(App.Vector(0.0,0.0,0.0),App.Rotation(0.0,0.0,0.0,1.0))
    App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(-7.5,0.0,0.0),App.Vector(20.0,0.0,0.0)))

    App.ActiveDocument.Symbol_EU.Placement = App.Placement(App.Vector(0.0,0.0),App.Rotation(0.0,0.0,0.0,1.0))
    App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(12.50,-7.5,0),App.Vector(12.50,7.5,0.0)))
    App.ActiveDocument.Symbol_EU.addGeometry(Part.Circle(App.Vector(12.50,0.0,0),App.Vector(0,0,1),2.5))
    App.ActiveDocument.Symbol_EU.addGeometry(Part.Circle(App.Vector(12.50,0.0,0),App.Vector(0,0,1),5.0))

    App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(5.0,5.0,0.0),App.Vector(-5.0,2.5,0.0)))
    App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(-5.0,-2.5,0.0),App.Vector(-5.0,2.5,0.0)))
    App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(5.0,-5.0,0.0),App.Vector(-5.0,-2.5,0.0)))
    App.ActiveDocument.Symbol_EU.addGeometry(Part.Line(App.Vector(5.0,-5.0,0.0),App.Vector(5.0,5.0,0.0)))
    Gui.getDocument(App.ActiveDocument.Name).resetEdit()
    FreeCADGui.getDocument(App.ActiveDocument.Name).getObject("Symbol_EU").LineColor = (0.0,0.0,0.0)
    App.ActiveDocument.recompute()

    App.activeDocument().addObject('Drawing::FeatureViewPart','SymbolEU')
    App.activeDocument().SymbolEU.Source = App.activeDocument().Symbol_EU
    App.activeDocument().SymbolEU.Direction = (0.0,0.0,1.0)
    App.activeDocument().SymbolEU.X = depx
    App.activeDocument().SymbolEU.Y = depy
    App.activeDocument().SymbolEU.Scale = scale #0.8    # A3

    App.activeDocument().Page.addObject(App.activeDocument().SymbolEU)
#    App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_EU")
    FreeCADGui.getDocument(App.ActiveDocument.Name).getObject("Symbol_EU").Visibility = False
    App.ActiveDocument.recompute()

def symbol_US(depx, depy, scale):    #symbol_US O=
    try:
        App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_US")
    except:
        None
    try:
        App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_EU")
    except:
        None
    try:
        App.getDocument(App.ActiveDocument.Name).removeObject("SymbolUS")
    except:
        None
    try:
        App.getDocument(App.ActiveDocument.Name).removeObject("SymbolEU")
    except:
        None
    App.activeDocument().addObject('Sketcher::SketchObject','Symbol_US')
    App.activeDocument().Symbol_US.Placement = App.Placement(App.Vector(0.0,0.0,0.0),App.Rotation(0.0,0.0,0.0,1.0))
    App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(-7.5,0.0,0.0),App.Vector(20.0,0.0,0.0)))

    App.ActiveDocument.Symbol_US.Placement = App.Placement(App.Vector(0.0,0.0),App.Rotation(0.0,0.0,0.0,1.0))
    App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(0.0,-7.5,0.0),App.Vector(0.0,7.5,0.0)))
    App.ActiveDocument.Symbol_US.addGeometry(Part.Circle(App.Vector(0.0,0.0,0.0),App.Vector(0,0,1),2.5))
    App.ActiveDocument.Symbol_US.addGeometry(Part.Circle(App.Vector(0.0,0.0,0.0),App.Vector(0,0,1),5.0))

    App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(17.5,5.0,0.0),App.Vector(7.5,2.5,0.0)))
    App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(7.5,-2.5,0.0),App.Vector(7.5,2.5,0.0)))
    App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(17.5,-5.0,0.0),App.Vector(7.5,-2.5,0.0)))
    App.ActiveDocument.Symbol_US.addGeometry(Part.Line(App.Vector(17.5,-5.0,0.0),App.Vector(17.5,5.0,0.0)))
    Gui.getDocument(App.ActiveDocument.Name).resetEdit()
    FreeCADGui.getDocument(App.ActiveDocument.Name).getObject("Symbol_US").LineColor = (0.0,0.0,0.0)
    App.ActiveDocument.recompute()

    App.activeDocument().addObject('Drawing::FeatureViewPart','SymbolUS')
    App.activeDocument().SymbolUS.Source = App.activeDocument().Symbol_US
    App.activeDocument().SymbolUS.Direction = (0.0,0.0,1.0)
    App.activeDocument().SymbolUS.X = depx
    App.activeDocument().SymbolUS.Y = depy
    App.activeDocument().SymbolUS.Scale = scale #0.8    # A3

    App.activeDocument().Page.addObject(App.activeDocument().SymbolUS)
#    App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_US")
    FreeCADGui.getDocument(App.ActiveDocument.Name).getObject("Symbol_US").Visibility = False
    App.ActiveDocument.recompute()

try:
    DESIGNED_BY   = App.activeDocument().getObject("Page").EditableTexts[0]  # lineEdit01 DESIGNED_BY
    CREATION_DATE = App.activeDocument().getObject("Page").EditableTexts[1]  # lineEdit02 CREATION_DATE date
    try:
        CREA_DATE = CREATION_DATE.split(" - ")[0]                            # lineEdit02h date
    except:
        CREA_DATE = CREATION_DATE
    try:
        CREA_TIME = CREATION_DATE.split(" - ")[1]                            # lineEdit02h heure
    except: None    
    CHECKED_BY = App.activeDocument().getObject("Page").EditableTexts[2]     # lineEdit03
    CHECK_DATE = App.activeDocument().getObject("Page").EditableTexts[3]     # lineEdit04 date
    try:
        CHEC_DATE = CHECK_DATE.split(" - ")[0]                               # lineEdit04 date
    except:
        CHEC_DATE = CHECK_DATE
    try:
        CHEC_TIME = CHECK_DATE.split(" - ")[1]                               # lineEdit04h heure
    except: None    
    SIZE = App.activeDocument().getObject("Page").EditableTexts[4]           # lineEdit05
    SCALE = App.activeDocument().getObject("Page").EditableTexts[5]          # lineEdit06
    WEIGHT = App.activeDocument().getObject("Page").EditableTexts[6]         # lineEdit07
    DRAWING_NUMBER = App.activeDocument().getObject("Page").EditableTexts[7] # lineEdit08
    SHEET = App.activeDocument().getObject("Page").EditableTexts[8]          # lineEdit09
    TITLE = App.activeDocument().getObject("Page").EditableTexts[9]          # textEdit_01
    DESCRIPTION = App.activeDocument().getObject("Page").EditableTexts[10]   # textEdit_02
    COMPANY = App.activeDocument().getObject("Page").EditableTexts[11]       # textEdit_02b
    COPYRIGHT = App.activeDocument().getObject("Page").EditableTexts[12]     # lineEdit_20
    Note_A = App.activeDocument().getObject("Page").EditableTexts[13]        # lineEdit_10
    Note_B = App.activeDocument().getObject("Page").EditableTexts[14]        # lineEdit_11
    Note_C = App.activeDocument().getObject("Page").EditableTexts[15]        # lineEdit_12
    Note_D = App.activeDocument().getObject("Page").EditableTexts[16]        # lineEdit_13
    Note_E = App.activeDocument().getObject("Page").EditableTexts[17]        # lineEdit_14
    Note_F = App.activeDocument().getObject("Page").EditableTexts[18]        # lineEdit_15
    Note_G = App.activeDocument().getObject("Page").EditableTexts[19]        # lineEdit_16
    Note_H = App.activeDocument().getObject("Page").EditableTexts[20]        # lineEdit_17
    Note_I = App.activeDocument().getObject("Page").EditableTexts[21]        # lineEdit_18

except:
    errorDialog("Erreur cartouche")

class Ui_MainWindow(object):

    def __init__(self, MainWindow):
        global path
        self.window = MainWindow

        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(810, 400)
        MainWindow.setMaximumSize(QtCore.QSize(810, 400))
        self.centralWidget = QtGui.QWidget(MainWindow)
        self.centralWidget.setObjectName(_fromUtf8("centralWidget"))

#        self.pushButton01 = QtGui.QPushButton(self.centralWidget)
#        self.pushButton01.setGeometry(QtCore.QRect(115, 360, 93, 28))
#        self.pushButton01.setObjectName(_fromUtf8("pushButton01"))
#        self.pushButton01.clicked.connect(self.on_pushButton01_clicked) #connection pushButton01

        self.pushButton02 = QtGui.QPushButton(self.centralWidget)
        self.pushButton02.setGeometry(QtCore.QRect(225, 360, 93, 28))
        self.pushButton02.setObjectName(_fromUtf8("pushButton02"))
        self.pushButton02.clicked.connect(self.on_pushButton02_clicked) #connection pushButton02

        self.pushButton03 = QtGui.QPushButton(self.centralWidget)
        self.pushButton03.setGeometry(QtCore.QRect(335, 360, 93, 28))
        self.pushButton03.setObjectName(_fromUtf8("pushButton03"))
        self.pushButton03.clicked.connect(self.on_pushButton03_clicked) #connection pushButton03

        self.pushButton04 = QtGui.QPushButton(self.centralWidget)
        self.pushButton04.setGeometry(QtCore.QRect(445, 360, 93, 28))
        self.pushButton04.setObjectName(_fromUtf8("pushButton04"))
        self.pushButton04.clicked.connect(self.on_pushButton04_clicked) #connection pushButton04

        self.pushButton05 = QtGui.QPushButton(self.centralWidget)
        self.pushButton05.setGeometry(QtCore.QRect(555, 360, 93, 28))
        self.pushButton05.setObjectName(_fromUtf8("pushButton05"))
        self.pushButton05.clicked.connect(self.on_pushButton05_clicked) #connection pushButton05

        #####
        self.groupBox = QtGui.QGroupBox(self.centralWidget)
        self.groupBox.setGeometry(QtCore.QRect(20, 159, 190, 101))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))

        self.label_20 = QtGui.QLabel(self.groupBox)
        self.label_20.setGeometry(QtCore.QRect(115, 5, 61, 17))
        self.label_20.setObjectName(_fromUtf8("label_20"))
        ############### font and color Label
        font = QtGui.QFont()
        font.setBold(True)
        self.label_20.setFont(font)
        self.label_20.setStyleSheet("color : #ff0000")
        ############### font and color
        self.label_20.setVisible(False)

        self.radioButton_0 = QtGui.QRadioButton(self.groupBox)
        self.radioButton_0.setGeometry(QtCore.QRect(95, 1, 91, 17))
        self.radioButton_0.setChecked(True)
        self.radioButton_0.setEnabled(False)
        self.radioButton_0.setVisible(False)
        self.radioButton_0.setObjectName(_fromUtf8("radioButton_0"))

        self.radioButton_1 = QtGui.QRadioButton(self.groupBox)
        self.radioButton_1.setGeometry(QtCore.QRect(95, 20, 91, 17))
        self.radioButton_1.setObjectName(_fromUtf8("radioButton_1"))
        self.radioButton_1.clicked.connect(self.on_radioButton_A3_clicked)# connect radioButton_A3

        self.radioButton_2 = QtGui.QRadioButton(self.groupBox)
        self.radioButton_2.setGeometry(QtCore.QRect(95, 39, 91, 17))
        self.radioButton_2.setObjectName(_fromUtf8("radioButton_2"))
        self.radioButton_2.clicked.connect(self.on_radioButton_A3_clicked)# connect radioButton_A3

        self.radioButton_3 = QtGui.QRadioButton(self.groupBox)
        self.radioButton_3.setGeometry(QtCore.QRect(95, 58, 91, 17))
        self.radioButton_3.setObjectName(_fromUtf8("radioButton_3"))
        self.radioButton_3.clicked.connect(self.on_radioButton_A4_clicked)# connect radioButton_A4

        self.radioButton_4 = QtGui.QRadioButton(self.groupBox)
        self.radioButton_4.setGeometry(QtCore.QRect(95, 76, 91, 17))
        self.radioButton_4.setObjectName(_fromUtf8("radioButton_4"))
        self.radioButton_4.clicked.connect(self.on_radioButton_A4_clicked)# connect radioButton_A4

        self.lineEdit_05 = QtGui.QLineEdit(self.groupBox)
        self.lineEdit_05.setGeometry(QtCore.QRect(10, 20, 75, 41))
        font = QtGui.QFont()
        font.setPointSize(25)
        font.setBold(False)
        font.setWeight(50)
        self.lineEdit_05.setFont(font)
        self.lineEdit_05.setAlignment(QtCore.Qt.AlignCenter)
        self.lineEdit_05.setObjectName(_fromUtf8("lineEdit_05"))
        self.lineEdit_05.setText(SIZE)

        self.pushButton10 = QtGui.QPushButton(self.groupBox)
        self.pushButton10.setGeometry(QtCore.QRect(10, 70, 75, 23))
        self.pushButton10.setObjectName(_fromUtf8("pushButton10"))
        self.pushButton10.clicked.connect(self.on_pushButton10_clicked) #connection pushButton10
        #####

        self.pushButton06 = QtGui.QPushButton(self.centralWidget)
        self.pushButton06.setGeometry(QtCore.QRect(170, 57, 20, 20))
        self.pushButton06.setObjectName(_fromUtf8("pushButton06"))
        self.pushButton06.clicked.connect(self.on_pushButton06_clicked) #connection pushButton06

        self.pushButton07 = QtGui.QPushButton(self.centralWidget)
        self.pushButton07.setGeometry(QtCore.QRect(190, 57, 20, 20))
        self.pushButton07.setObjectName(_fromUtf8("pushButton07"))
        self.pushButton07.clicked.connect(self.on_pushButton07_clicked) #connection pushButton07

        self.pushButton08 = QtGui.QPushButton(self.centralWidget)
        self.pushButton08.setGeometry(QtCore.QRect(170, 137, 20, 20))
        self.pushButton08.setObjectName(_fromUtf8("pushButton08"))
        self.pushButton08.clicked.connect(self.on_pushButton08_clicked) #connection pushButton08

        self.pushButton09 = QtGui.QPushButton(self.centralWidget)
        self.pushButton09.setGeometry(QtCore.QRect(190, 137, 20, 20))
        self.pushButton09.setObjectName(_fromUtf8("pushButton09"))
        self.pushButton09.clicked.connect(self.on_pushButton09_clicked) #connection pushButton09

        self.lineEdit_01 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_01.setGeometry(QtCore.QRect(20, 20, 190, 16))
        font = QtGui.QFont()
        font.setPointSize(7)
        self.lineEdit_01.setFont(font)
        self.lineEdit_01.setObjectName(_fromUtf8("lineEdit_01"))
        self.lineEdit_01.setText(DESIGNED_BY)

        self.lineEdit_02 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_02.setGeometry(QtCore.QRect(20, 60, 82, 16))
        font = QtGui.QFont()
        font.setPointSize(7)
        self.lineEdit_02.setFont(font)
        self.lineEdit_02.setObjectName(_fromUtf8("lineEdit_02"))
        self.lineEdit_02.setText(CREA_DATE)

        self.lineEdit_02h = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_02h.setGeometry(QtCore.QRect(98, 60, 72, 16))
        font = QtGui.QFont()
        font.setPointSize(7)
        self.lineEdit_02h.setFont(font)
        self.lineEdit_02h.setObjectName(_fromUtf8("lineEdit_02h"))
        self.lineEdit_02h.setText(CREA_TIME)

        self.lineEdit_03 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_03.setGeometry(QtCore.QRect(20, 100, 190, 16))
        font = QtGui.QFont()
        font.setPointSize(7)
        self.lineEdit_03.setFont(font)
        self.lineEdit_03.setObjectName(_fromUtf8("lineEdit_03"))
        self.lineEdit_03.setText(CHECKED_BY)

        self.lineEdit_04 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_04.setGeometry(QtCore.QRect(20, 140, 82, 16))
        font = QtGui.QFont()
        font.setPointSize(7)
        self.lineEdit_04.setFont(font)
        self.lineEdit_04.setObjectName(_fromUtf8("lineEdit_04"))
        self.lineEdit_04.setText(CHEC_DATE)

        self.lineEdit_04h = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_04h.setGeometry(QtCore.QRect(98, 140, 72, 16))
        font = QtGui.QFont()
        font.setPointSize(7)
        self.lineEdit_04h.setFont(font)
        self.lineEdit_04h.setObjectName(_fromUtf8("lineEdit_04h"))
        self.lineEdit_04h.setText(CHEC_TIME)

        self.lineEdit_06 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_06.setGeometry(QtCore.QRect(20, 280, 61, 41))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.lineEdit_06.setFont(font)
        self.lineEdit_06.setAlignment(QtCore.Qt.AlignCenter)
        self.lineEdit_06.setObjectName(_fromUtf8("lineEdit_06"))
        self.lineEdit_06.setText(SCALE)

        self.lineEdit_07 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_07.setGeometry(QtCore.QRect(100, 280, 101, 41))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.lineEdit_07.setFont(font)
        self.lineEdit_07.setAlignment(QtCore.Qt.AlignCenter)
        self.lineEdit_07.setObjectName(_fromUtf8("lineEdit_07"))
        self.lineEdit_07.setText(WEIGHT)

        self.lineEdit_08 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_08.setGeometry(QtCore.QRect(220, 280, 341, 41))
        self.lineEdit_08.setObjectName(_fromUtf8("lineEdit_08"))
        self.lineEdit_08.setText(DRAWING_NUMBER)

        self.lineEdit_09 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_09.setGeometry(QtCore.QRect(570, 280, 81, 41))
        self.lineEdit_09.setObjectName(_fromUtf8("lineEdit_09"))
        self.lineEdit_09.setText(SHEET)

        self.lineEdit_20 = QtGui.QLineEdit(self.centralWidget) # Copyright
        self.lineEdit_20.setGeometry(QtCore.QRect(20, 330, 771, 22))
        self.lineEdit_20.setObjectName(_fromUtf8("lineEdit_20"))
        self.lineEdit_20.setText(COPYRIGHT)

        self.lineEdit_10 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_10.setGeometry(QtCore.QRect(690, 290, 101, 30))
        self.lineEdit_10.setObjectName(_fromUtf8("lineEdit_10"))
        self.lineEdit_10.setText(Note_A)

        self.lineEdit_11 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_11.setGeometry(QtCore.QRect(690, 260, 101, 30))
        self.lineEdit_11.setObjectName(_fromUtf8("lineEdit_11"))
        self.lineEdit_11.setText(Note_B)

        self.lineEdit_12 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_12.setGeometry(QtCore.QRect(690, 230, 101, 30))
        self.lineEdit_12.setObjectName(_fromUtf8("lineEdit_12"))
        self.lineEdit_12.setText(Note_C)

        self.lineEdit_13 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_13.setGeometry(QtCore.QRect(690, 200, 101, 30))
        self.lineEdit_13.setObjectName(_fromUtf8("lineEdit_13"))
        self.lineEdit_13.setText(Note_D)

        self.lineEdit_14 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_14.setGeometry(QtCore.QRect(690, 170, 101, 30))
        self.lineEdit_14.setObjectName(_fromUtf8("lineEdit_14"))
        self.lineEdit_14.setText(Note_E)

        self.lineEdit_15 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_15.setGeometry(QtCore.QRect(690, 140, 101, 30))
        self.lineEdit_15.setObjectName(_fromUtf8("lineEdit_15"))
        self.lineEdit_15.setText(Note_F)

        self.lineEdit_16 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_16.setGeometry(QtCore.QRect(690, 110, 101, 30))
        self.lineEdit_16.setObjectName(_fromUtf8("lineEdit_16"))
        self.lineEdit_16.setText(Note_G)

        self.lineEdit_17 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_17.setGeometry(QtCore.QRect(690, 80, 101, 30))
        self.lineEdit_17.setObjectName(_fromUtf8("lineEdit_17"))
        self.lineEdit_17.setText(Note_H)

        self.lineEdit_18 = QtGui.QLineEdit(self.centralWidget)
        self.lineEdit_18.setGeometry(QtCore.QRect(690, 50, 101, 30))
        self.lineEdit_18.setObjectName(_fromUtf8("lineEdit_18"))
        self.lineEdit_18.setText(Note_I)

        self.label_01T = QtGui.QLabel(self.centralWidget)
        self.label_01T.setGeometry(QtCore.QRect(220, 0, 91, 16))
        self.label_01T.setObjectName(_fromUtf8("label_01T"))

        self.textEdit_01 = QtGui.QTextEdit(self.centralWidget)            # Title
        self.textEdit_01.setGeometry(QtCore.QRect(220, 20, 431,55 ))
        font = QtGui.QFont()
        font.setPointSize(15)
        font.setBold(True)
        font.setWeight(75)
        self.textEdit_01.setFont(font)
        self.textEdit_01.setObjectName(_fromUtf8("textEdit_01"))
        self.textEdit_01.setText(TITLE)

        self.label_02T = QtGui.QLabel(self.centralWidget)
        self.label_02T.setGeometry(QtCore.QRect(220, 80, 101, 16))
        self.label_02T.setObjectName(_fromUtf8("label_02T"))

        self.textEdit_02 = QtGui.QTextEdit(self.centralWidget)            # DESCRIPTION
        self.textEdit_02.setGeometry(QtCore.QRect(220, 100, 431, 55))
        self.textEdit_02.setObjectName(_fromUtf8("textEdit_02"))
        self.textEdit_02.setText(DESCRIPTION)

        self.label_02bT = QtGui.QLabel(self.centralWidget)
        self.label_02bT.setGeometry(QtCore.QRect(220, 160, 90, 16))
        self.label_02bT.setObjectName(_fromUtf8("label_02bT"))

        self.textEdit_02b = QtGui.QTextEdit(self.centralWidget)            # COMPANY
        self.textEdit_02b.setGeometry(QtCore.QRect(220, 180, 340, 60))
        self.textEdit_02b.setObjectName(_fromUtf8("textEdit_02b"))
        self.textEdit_02b.setText(COMPANY)

        self.label_01 = QtGui.QLabel(self.centralWidget)
        self.label_01.setGeometry(QtCore.QRect(20, 0, 91, 16))
        self.label_01.setObjectName(_fromUtf8("label_01"))

        self.label_02 = QtGui.QLabel(self.centralWidget)
        self.label_02.setGeometry(QtCore.QRect(20, 40, 53, 16))
        self.label_02.setObjectName(_fromUtf8("label_02"))

        self.label_03 = QtGui.QLabel(self.centralWidget)
        self.label_03.setGeometry(QtCore.QRect(20, 80, 101, 16))
        self.label_03.setObjectName(_fromUtf8("label_03"))

        self.label_04 = QtGui.QLabel(self.centralWidget)
        self.label_04.setGeometry(QtCore.QRect(20, 120, 91, 16))
        self.label_04.setObjectName(_fromUtf8("label_04"))

        self.label_06 = QtGui.QLabel(self.centralWidget)
        self.label_06.setGeometry(QtCore.QRect(20, 260, 53, 16))
        self.label_06.setObjectName(_fromUtf8("label_06"))

        self.label_07 = QtGui.QLabel(self.centralWidget)
        self.label_07.setGeometry(QtCore.QRect(100, 260, 101, 16))
        self.label_07.setObjectName(_fromUtf8("label_07"))

        self.label_08 = QtGui.QLabel(self.centralWidget)
        self.label_08.setGeometry(QtCore.QRect(220, 260, 121, 16))
        self.label_08.setObjectName(_fromUtf8("label_08"))

        self.label_09 = QtGui.QLabel(self.centralWidget)
        self.label_09.setGeometry(QtCore.QRect(570, 260, 53, 16))
        self.label_09.setObjectName(_fromUtf8("label_09"))

        self.label_10 = QtGui.QLabel(self.centralWidget)
        self.label_10.setGeometry(QtCore.QRect(670, 290, 16, 33))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_10.setFont(font)
        self.label_10.setObjectName(_fromUtf8("label_10"))

        self.label_11 = QtGui.QLabel(self.centralWidget)
        self.label_11.setGeometry(QtCore.QRect(670, 260, 16, 33))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_11.setFont(font)
        self.label_11.setObjectName(_fromUtf8("label_11"))

        self.label_12 = QtGui.QLabel(self.centralWidget)
        self.label_12.setGeometry(QtCore.QRect(670, 230, 16, 33))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_12.setFont(font)
        self.label_12.setObjectName(_fromUtf8("label_12"))

        self.label_13 = QtGui.QLabel(self.centralWidget)
        self.label_13.setGeometry(QtCore.QRect(670, 200, 18, 33))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_13.setFont(font)
        self.label_13.setObjectName(_fromUtf8("label_13"))

        self.label_14 = QtGui.QLabel(self.centralWidget)
        self.label_14.setGeometry(QtCore.QRect(670, 170, 15, 33))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_14.setFont(font)
        self.label_14.setObjectName(_fromUtf8("label_14"))

        self.label_15 = QtGui.QLabel(self.centralWidget)
        self.label_15.setGeometry(QtCore.QRect(670, 140, 14, 33))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_15.setFont(font)
        self.label_15.setObjectName(_fromUtf8("label_15"))

        self.label_16 = QtGui.QLabel(self.centralWidget)
        self.label_16.setGeometry(QtCore.QRect(670, 110, 18, 33))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_16.setFont(font)
        self.label_16.setObjectName(_fromUtf8("label_16"))

        self.label_17 = QtGui.QLabel(self.centralWidget)
        self.label_17.setGeometry(QtCore.QRect(670, 80, 18, 33))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_17.setFont(font)
        self.label_17.setObjectName(_fromUtf8("label_17"))

        self.label_18 = QtGui.QLabel(self.centralWidget)
        self.label_18.setGeometry(QtCore.QRect(670, 50, 10, 33))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_18.setFont(font)
        self.label_18.setObjectName(_fromUtf8("label_18"))

        self.label_19 = QtGui.QLabel(self.centralWidget)
        self.label_19.setGeometry(QtCore.QRect(720, 15, 100, 33))
        self.label_19.setObjectName(_fromUtf8("label_19"))

        MainWindow.setCentralWidget(self.centralWidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        try:
            MainWindow.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # cette fonction met la fenêtre en avant
        except Exception:
            MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # cette fonction met la fenêtre en avant
        MainWindow.setWindowTitle(_translate("MainWindow", "Cartouche (Full)", None))
#        self.pushButton01.setText(_translate("MainWindow", "Position", None))
        self.pushButton02.setText(_translate("MainWindow", "Quitter", None))
        self.pushButton03.setText(_translate("MainWindow", "Memo", None))
        self.pushButton04.setText(_translate("MainWindow", "Nettoyer", None))
        self.pushButton05.setText(_translate("MainWindow", "Appliquer", None))
        self.pushButton06.setText(_translate("MainWindow", "D.", None))
        self.pushButton07.setText(_translate("MainWindow", "H.", None))
        self.pushButton08.setText(_translate("MainWindow", "D.", None))
        self.pushButton09.setText(_translate("MainWindow", "H.", None))
        self.pushButton10.setText(_translate("MainWindow", "For US Symb.", None))

        self.label_01.setText(_translate("MainWindow", "Designed by :", None))
        self.label_02.setText(_translate("MainWindow", "Date :", None))
        self.label_03.setText(_translate("MainWindow", "Checked by :", None))
        self.label_04.setText(_translate("MainWindow", "Date :", None))
        self.label_06.setText(_translate("MainWindow", "Scale :", None))
        self.label_07.setText(_translate("MainWindow", "Weight (Kg) :", None))
        self.label_08.setText(_translate("MainWindow", "Drawing number :", None))
        self.label_01T.setText(_translate("MainWindow", "Title :", None))
        self.label_02T.setText(_translate("MainWindow", "Description :", None))
        self.label_02bT.setText(_translate("MainWindow", "Company :", None))
        self.label_09.setText(_translate("MainWindow", "Sheet :", None))

        self.label_10.setText(_translate("MainWindow", "A", None))
        self.label_11.setText(_translate("MainWindow", "B", None))
        self.label_12.setText(_translate("MainWindow", "C", None))
        self.label_13.setText(_translate("MainWindow", "D", None))
        self.label_14.setText(_translate("MainWindow", "E", None))
        self.label_15.setText(_translate("MainWindow", "F", None))
        self.label_16.setText(_translate("MainWindow", "G", None))
        self.label_17.setText(_translate("MainWindow", "H", None))
        self.label_18.setText(_translate("MainWindow", "I", None))
        self.label_19.setText(_translate("MainWindow", "Notes", None))
        self.label_20.setText(_translate("MainWindow", "Warning", None))

        self.groupBox.setTitle(_translate("MainWindow", "Size :", None))
        self.radioButton_1.setText(_translate("MainWindow", "A3 Landscape", None))
        self.radioButton_2.setText(_translate("MainWindow", "A3 Portrait", None))
        self.radioButton_3.setText(_translate("MainWindow", "A4 Landscape", None))
        self.radioButton_4.setText(_translate("MainWindow", "A4 Portrait", None))
        self.lineEdit_05.setText(_translate("MainWindow", "?", None))

#______________________________________________________________________________________
    # Radio Boutons
    def on_radioButton_A3_clicked(self):  # connect radioButton_A3
        self.label_20.setVisible(False)
        self.lineEdit_05.setText(_translate("MainWindow", "A3", None))
    def on_radioButton_A4_clicked(self):  # connect radioButton_A4
        self.label_20.setVisible(False)
        self.lineEdit_05.setText(_translate("MainWindow", "A4", None))
    # Boutons
    def on_pushButton10_clicked(self):    # Bouton /Symbole
        global SymbolSwitch
        global path
        self.label_20.setVisible(False)
        if SymbolSwitch == 1:
            self.pushButton10.setText(_translate("MainWindow", "For US Symb.", None))
            if self.radioButton_1.isChecked():
                symbol_EU(247.5, 263.5, 0.8)  # A3 Landscape
            if self.radioButton_2.isChecked():
                symbol_EU(124.55, 386.3, 0.8) # A3 Portrait
            if self.radioButton_3.isChecked():
                symbol_EU(158.7, 181.35, 0.6) # A4 Landscape
            if self.radioButton_4.isChecked():
                symbol_EU(71.9, 269.0, 0.6)   # A4 Portrait
            SymbolSwitch = 0
        else:
            self.pushButton10.setText(_translate("MainWindow", "For EU Symb.", None))
            if self.radioButton_1.isChecked():
                symbol_US(247.5, 263.5, 0.8)  # A3 Landscape
            if self.radioButton_2.isChecked():
                symbol_US(124.55, 386.3, 0.8) # A3 Portrait
            if self.radioButton_3.isChecked():
                symbol_US(158.7, 181.35, 0.6) # A4 Landscape
            if self.radioButton_4.isChecked():
                symbol_US(71.9, 269.0, 0.6)   # A4 Portrait
            SymbolSwitch = 1

        if self.radioButton_0.isChecked():
            self.label_20.setVisible(True)
            FreeCAD.Console.PrintError("Select one format A3 or A4 for the Symbole" + "\n")

    def on_pushButton09_clicked(self):    # Bouton /heure document
        self.lineEdit_04h.setText(str(heure()))
    def on_pushButton08_clicked(self):    # Bouton date/ document
        if self.pushButton10=="Symbole US":
            self.lineEdit_04.setText(str(dateUs()))
        else:
            self.lineEdit_04.setText(str(dateEu()))
    def on_pushButton07_clicked(self):    # Bouton /heure checked
        self.lineEdit_02h.setText(str(heure()))
    def on_pushButton06_clicked(self):    # Bouton date/ checked
        if self.pushButton10=="Symbole US":
            self.lineEdit_02.setText(str(dateUs()))
        else:
            self.lineEdit_02.setText(str(dateEu()))
    def on_pushButton05_clicked(self):    # Bouton Appliquer
        try:
            global ui
            global SymbolSwitch
            if SymbolSwitch == 1:
                SymbolSwitch = 0
            else:
                SymbolSwitch = 1
            ff = ui
            ff.on_pushButton10_clicked()

            DESIGNED_BY = utf8(self.lineEdit_01.text())
            CREATION_DATE = utf8(self.lineEdit_02.text())+" - "+utf8(self.lineEdit_02h.text())
            CHECKED_BY = utf8(self.lineEdit_03.text())
            CHECK_DATE = utf8(self.lineEdit_04.text())+" - "+utf8(self.lineEdit_04h.text())
            SIZE = utf8(self.lineEdit_05.text())
            SCALE = utf8(self.lineEdit_06.text())
            WEIGHT = utf8(self.lineEdit_07.text())
            DRAWING_NUMBER = utf8(self.lineEdit_08.text())
            SHEET = utf8(self.lineEdit_09.text())
            TITLE = utf8(self.textEdit_01.toPlainText())
            DESCRIPTION = utf8(self.textEdit_02.toPlainText())
            COMPANY = utf8(self.textEdit_02b.toPlainText())
            COPYRIGHT = utf8(self.lineEdit_20.text())
            Note_A = utf8(self.lineEdit_10.text())
            Note_B = utf8(self.lineEdit_11.text())
            Note_C = utf8(self.lineEdit_12.text())
            Note_D = utf8(self.lineEdit_13.text())
            Note_E = utf8(self.lineEdit_14.text())
            Note_F = utf8(self.lineEdit_15.text())
            Note_G = utf8(self.lineEdit_16.text())
            Note_H = utf8(self.lineEdit_17.text())
            Note_I = utf8(self.lineEdit_18.text())
            try:
                FreeCAD.getDocument (App.ActiveDocument.Name).getObject("Page").EditableTexts = [unicode(DESIGNED_BY, 'utf-8'),unicode(CREATION_DATE, 'utf-8'),unicode(CHECKED_BY, 'utf-8'),       unicode(CHECK_DATE, 'utf-8'),  unicode(SIZE, 'utf-8'),  unicode(SCALE, 'utf-8'),  unicode(WEIGHT, 'utf-8'),  unicode(DRAWING_NUMBER, 'utf-8'),  unicode(SHEET, 'utf-8'),  unicode(TITLE, 'utf-8'),  unicode(DESCRIPTION, 'utf-8'),  unicode(COMPANY, 'utf-8'),  unicode(COPYRIGHT, 'utf-8'),  unicode(Note_A, 'utf-8'),  unicode(Note_B, 'utf-8'),  unicode(Note_C, 'utf-8'),  unicode(Note_D, 'utf-8'),  unicode(Note_E, 'utf-8'),  unicode(Note_F, 'utf-8'),  unicode(Note_G, 'utf-8'),  unicode(Note_H, 'utf-8'),  unicode(Note_I, 'utf-8'),]
                App.ActiveDocument.recompute()
            except:
                FreeCAD.getDocument (App.ActiveDocument.Name).getObject("Page").EditableTexts = [DESIGNED_BY.encode('utf-8'), CREATION_DATE.encode('utf-8'), CHECKED_BY.encode('utf-8'), CHECK_DATE.encode('utf-8'), SIZE.encode('utf-8'), SCALE.encode('utf-8'), WEIGHT.encode('utf-8'), DRAWING_NUMBER.encode('utf-8'), SHEET.encode('utf-8'), TITLE.encode('utf-8'), DESCRIPTION.encode('utf-8'), COMPANY.encode('utf-8'), COPYRIGHT.encode('utf-8'), Note_A.encode('utf-8'), Note_B.encode('utf-8'), Note_C.encode('utf-8'), Note_D.encode('utf-8'), Note_E.encode('utf-8'), Note_F.encode('utf-8'), Note_G.encode('utf-8'), Note_H.encode('utf-8'), Note_I.encode('utf-8'), ]
                App.ActiveDocument.recompute()
        except Exception:
            None
            FreeCAD.Console.PrintError("Error or not page" + "\n")
#        App.ActiveDocument.recompute()

    def on_pushButton04_clicked(self):    # Bouton nettoyer
        try:
            App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_US")
        except:
            None
        try:
            App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_EU")
        except:
            None
        try:
            App.getDocument(App.ActiveDocument.Name).removeObject("SymbolUS")
        except:
            None
        try:
            App.getDocument(App.ActiveDocument.Name).removeObject("SymbolEU")
        except:
            None

        DESIGNED_BY = ""    ;self.lineEdit_01.setText("")
        CREATION_DATE = ""  ;self.lineEdit_02.setText("")
        self.lineEdit_02h.setText("")
        CHECKED_BY = ""     ;self.lineEdit_03.setText("")
        CHECK_DATE = ""     ;self.lineEdit_04.setText("")
        self.lineEdit_04h.setText("")
        SIZE  = ""          ;self.lineEdit_05.setText("")
        SCALE = ""          ;self.lineEdit_06.setText("")
        WEIGHT = ""         ;self.lineEdit_07.setText("")
        DRAWING_NUMBER = "" ;self.lineEdit_08.setText("")
        SHEET = ""          ;self.lineEdit_09.setText("")
        TITLE = ""          ;self.textEdit_01.setText("")
        DESCRIPTION = ""    ;self.textEdit_02.setText("")
        COMPANY = ""        ;self.textEdit_02b.setText("")
        COPYRIGHT = ""      ;self.lineEdit_20.setText("")
        Note_A = ""         ;self.lineEdit_10.setText("")
        Note_B = ""         ;self.lineEdit_11.setText("")
        Note_C = ""         ;self.lineEdit_12.setText("")
        Note_D = ""         ;self.lineEdit_13.setText("")
        Note_E = ""         ;self.lineEdit_14.setText("")
        Note_F = ""         ;self.lineEdit_15.setText("")
        Note_G = ""         ;self.lineEdit_16.setText("")
        Note_H = ""         ;self.lineEdit_17.setText("")
        Note_I = ""         ;self.lineEdit_18.setText("")
        self.lineEdit_05.setText("?")
        self.label_20.setVisible(False)
        self.radioButton_0.setChecked(True)

    def on_pushButton03_clicked(self):    # Bouton Memo
        self.lineEdit_01.setText(DESIGNED_BY)
        self.lineEdit_02.setText(CREA_DATE)
        self.lineEdit_02h.setText(CREA_TIME)
        self.lineEdit_03.setText(CHECKED_BY)
        self.lineEdit_04.setText(CHEC_DATE)
        self.lineEdit_04h.setText(CHEC_TIME)
        self.lineEdit_05.setText("?") #(SIZE)
        self.lineEdit_06.setText(SCALE)
        self.lineEdit_07.setText(WEIGHT)
        self.lineEdit_08.setText(DRAWING_NUMBER)
        self.lineEdit_09.setText(SHEET)
        self.textEdit_01.setText(TITLE)
        self.textEdit_02.setText(DESCRIPTION)
        self.textEdit_02b.setText(COMPANY)
        self.lineEdit_20.setText(COPYRIGHT)
        self.lineEdit_10.setText(Note_A)
        self.lineEdit_11.setText(Note_B)
        self.lineEdit_12.setText(Note_C)
        self.lineEdit_13.setText(Note_D)
        self.lineEdit_14.setText(Note_E)
        self.lineEdit_15.setText(Note_F)
        self.lineEdit_16.setText(Note_G)
        self.lineEdit_17.setText(Note_H)
        self.lineEdit_18.setText(Note_I)
        self.radioButton_0.setChecked(True)

    def on_pushButton02_clicked(self):    # Bouton Quitter
        App.Console.PrintMessage("Terminé\r\n")
        self.window.hide()
#    def on_pushButton01_clicked(self):    # Bouton appel de Position
#        MainWindow.resize(210, 480)
#        executer()
#        MainWindow.resize(810, 480)
#______________________________________________________________________________________

MainWindow = QtGui.QMainWindow()
ui = Ui_MainWindow(MainWindow)
MainWindow.show()

Other

The fields have no length limit, check your cartouche.

This program creates a drawing representing the regional projection symbol on your project, do not touch it is registered therefore hidden form invisible.

If you want it to be cleared uncomment the commented lines and vice versa

#    App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_EU")
    FreeCADGui.getDocument(App.ActiveDocument.Name).getObject("Symbol_EU").Visibility = False

et

#    App.getDocument(App.ActiveDocument.Name).removeObject("Symbol_US")
    FreeCADGui.getDocument(App.ActiveDocument.Name).getObject("Symbol_US").Visibility = False

(I had some times an error in execution when the symbol was erased)

This module works with the drawing sheet included in FreeCAD this sheet is called Page, do not change the name of this sheet!

Revision

ver 5 : 08/08/2014 PyQt4 and PySide

ver 5 : 08/08/2014 PyQt4 and PySide