Macro FCInfo/cs: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updating to match new version of source page)
(125 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
{{Macro|Icon=FCInfo|Name=Macro_FCInfo|Description=Dává řadu informací o tvaru.|Author=Mario52}}


{{Macro
Dává řadu informací o vybraném tvaru a může zobrazit konverzi délky, sklonu (stupně, radiány) tělesa, povrchu a váhy tvaru s měrnou hmotností vybranou v různých jednotkách hmotnosti mezinárodních i Anglo-Saských.
|Name=Macro FCInfo
|Icon=FCInfo.png
|Description=Gives information about the selected shape and can display a conversion of length, inclination (degrees, radians, grades, percent), area, volume and weight in different units (metric and imperial). The macro now also works for the elements of a sketch in edit mode.
<br />French Version [https://gist.githubusercontent.com/mario52a/6afc64081c4eb8be3b93/raw/da448b70d27ee82c496b04ffb68f5224c653bed1/FCInfo_fr_Ver_1-28c-rmu_Docked.FCMacro Version française]
|Author=Mario52
|Download=[https://wiki.freecad.org/images/5/53/FCInfo.png ToolBar Icon]
|Version=1.28c
|Date=2023/10/30
|FCVersion=All
|SeeAlso=[[Arch_Survey|Arch Survey]], [[Macro_SimpleProperties|Macro SimpleProperties]], [[Macro_FCInfoGlass|Macro FCInfoGlass]]
}}


==Description==


<div class="mw-translate-fuzzy">
[[File:Macro_FCInfo_00_en.png|480px|FCInfo]]
==Popis==
Dává řadu informací o vybraném tvaru a může zobrazit konverzi délky, sklonu (stupně, radiány, procenta) tělesa, povrchu, objemu a váhy tvaru s měrnou hmotností vybranou v různých jednotkách hmotnosti mezinárodních i Anglo-Saských.
</div>


{{Codeextralink|https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/c18679d096d168133e6f9e914774b3ba06ff6dc9/FCInfo_en_Ver_1-28c-rmu_Docked.FCMacro}}

[[File:Macro_FCInfo_00_en.png|480px]]
{{Caption|FCInfo}}

==Usage==

<div class="mw-translate-fuzzy">
===Použití===
===Použití===
Vyberete objekt nebo spustíte aplikaci a vyberete objekt a zobrazí se řada informací.
Vyberete objekt nebo spustíte aplikaci a vyberete objekt a zobrazí se řada informací.
Jeho výpočty založené na jednotce FreeCADu, což je '''mm''' pro kažbý nový výběr, vrací vždy délku v '''mm''' a úhel v '''dekadických stupních'''.
Jeho výpočty založené na jednotce FreeCADu, což je '''mm''' pro kažbý nový výběr, vrací vždy délku v '''mm''' a úhel v '''dekadických stupních'''.


[[File:Macro FCInfo 06.png|200px|left|upper window]][[File:Macro FCInfo 07.png|200px|lower window]]
Když makro jednou spustíte, zůstává aktivní a okno zůstává viditelné. Makro lze ukončit stisknutím {{KEY|Exit}}. Když okno zavřte křížkem (vpravo nahoře), makro zůstává v paměti a data se zobrazují v "reportovacím pohledu" FreeCADu.
</div>


<div class="mw-translate-fuzzy">
{{clear}}
'''Sector 1: Document'''
* Název dokumentu
* Označení objektu
* Interní název objektu
* Název dílčího objektu
* Typ objektu
</div>


===Volby===
====Použité jednotky====
=====Délková jednotka:=====
km, hm, dam, m, dm, cm, '''mm''', inch(palec), link, foot(stopa), yard, perch, chain, furlong, mile, league, nautique.
=====Úhlové stupně :=====
#'''dekadické stupně''', ex: 174.831872611°
#stupně minuty vteřiny, ex:<nowiki> 174° 49' 54.741401''</nowiki>
#radiány, ex: 3.05139181449 rad
#grade, ex: 194.257636235 gon
Pochopení úhlů v zobrazení FCInfo.
[[File:Macro FCInfo 02.png|300px|left|Pochopení úhlů v zobrazení FCInfo]]
{{clear}}
=====Váhové jednotky :=====
ton, quintal, kg, hg, dag, '''gram''', dg, cg, mg, gr (grain), dr (drachm), oz (once), oz t (once troy),<br />
lb t (livre troy), lb (livre av), st (stone), qtr (quarter), cwt (hundredweight)<br />
"spinBox" je nastaven na '''7,5''' kg, průměrná měrná hmotnost oceli. Chcete-li jinou defaultní (přednastavenou) hodnotu, změňte hodnotu měrné hmotnosti na řádku 164


===Sector 1: Document===
<syntaxhighlight>
global densite ; densite = 7.5 # (steel = 7.5 kg par dm3)
</syntaxhighlight>


[[File:Macro_FCInfo_Document_00.png|FCInfo Document]]
Soubor můůže být vytvořen tlačítkem {{KEY|Save}}. Takto je vytvořen soubor jako [https://fr.wikipedia.org/wiki/Comma-separated_values .csv] soubor, data mohou být prohlížena v tabulkovém editoru.
===Skript===
Zkopírujte obsah tohoto makra do souboru nazvaného "FCInfo.FCMacro" (ve Windowsech) do "C:\Program Files\FreeCAD0.13".<br />
Nebo přímo do okna FreeCADu <br />
Ikona musí být ve stejném adresáři jako je makro pro Windows "C:\Program Files\FreeCAD0.13".<br />
Klikněte na obrázky ikon [[File:FCInfo.png|64px]] [[File:FCInfoSpreadsheet.png|64px]] a pravým tlačítkem je "Uložte jako" (neměňte jméno) (originál - Download image positioning on the icon [[File:FCInfo.png|64px]] [[File:FCInfoSpreadsheet.png|64px]] and then drag the mouse right click "save as" (do not change the name))


*Document name
<syntaxhighlight>
*Label and internal name of the object
'''FCInfo.FCMacro'''
*Internal Name of the object
</syntaxhighlight>
*Sub element name and type of the object
*Type of the object
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_001_Document''' for hidden the Box)''


<span id="Sector_2:_Coordinates_click_mouse"></span>
<syntaxhighlight>
<div class="mw-translate-fuzzy">
'''Sector 2: Coordinates click mouse'''
* Souřadnice X, Y a Z kliknutím myší
* Tlačítko vytváří na bodové, osové, rovinné, kopírovací vektorové formě osy '' 'FreeCAD.Vector (-24.0, 240.0, 7.0)' ''
</div>


[[File:Macro_FCInfo_Coordinate_click_mouse_00.png|FCInfo Coordinate]]
# -*- coding: utf-8 -*-
"""
***************************************************************************
* Copyright (c) 2013 <mario52[at]users.sourceforge.net> *
* *
* 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 *
***************************************************************************
"""
# FCInfo.FCMacro
# https://fr.wikipedia.org/wiki/Kilogramme
# Select an object or launch the application and select an object, and a series of information appear.
# Calculations FreeCAD unit, which is the mm on each new selection, the unit of length-based his return still on mm and decimal degrees angle.
# Always leave by the "Exit" button if it exits the program without going through the button "Exit" the program remains in memory and continues to run.
# Should leave FreeCAD to erase memory.
# Only the first 200 objects are visible in the table if there are more than 200 items in the object a signal will be displayed by '(!+ 200),
# The complete list of data is visible in the backup file
#
#
# 04_04 19/11
# FreeCAD Ver 0.13 1828
# python 2.6 # Windows Vista SP2


*Coordinates X,Y and Z click to mouse
__title__ = "FCInfo"
*The {{Button|button}} creates point, axis, plane, copy vector axis from '''FreeCAD.Vector(-24.0, 240.0, 7.0)'''
__author__ = "Mario52"
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_002_Coordinate_Mouse''' for hidden the Box)''
__url__ = "http://www.freecadweb.org/wiki/index.php?title=Main_Page"
__version__ = "01.10.b"
__date__ = "19/11/2013"


===Sector 3: Color on point===
import Draft, Part, FreeCAD, math, PartGui, FreeCADGui, PyQt4
import Part
from math import sqrt, pi, sin, cos, asin, degrees, radians
from FreeCAD import Base
from PyQt4 import QtGui ,QtCore
from PyQt4.QtGui import QComboBox
from PyQt4.QtGui import QMessageBox
from PyQt4.QtGui import QTableWidget, QApplication


[[File:Macro_FCInfo_Color_on_point_00.png|FCInfo Color_on_point]]
from PyQt4.QtGui import *
from PyQt4.QtCore import *


<div class="mw-translate-fuzzy">
import csv
'''Sector 3: Value'''
* Délka objektu, je-li objekt obrys obličeje, zobrazí se velikost jednotky: <br /> km, hm, přehrada, m, dm, cm, '' 'mm' '', μm, fm, palec, propojení, noha, yard, bidélko, řetěz, furlong, míle, ligy, námořní. Je-li objekt kružnicí o jednu sekundu, zobrazí se políčkoEdit a zobrazí poloměr kružnice.
* Obvod tvaru
</div>


===Sector 4: Components Mesh===
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s


[[File:Componant_Mesh_v_1-28.png|FCInfo Component Mesh]]
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)


If the selection is a mesh object one new window '''''"Components"''''' is displayed and gives:
from math import sqrt, pi, sin, cos, asin, acos, atan, atan2, degrees


*Edges : number of edges {{LineEdit|9561}}.
def errorDialog(msg):
*Faces : number of faces {{LineEdit|6374}}.
diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,"Error Message",msg )
*Points : number of points {{LineEdit|3189}}.
diag.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # This function updates the window forward
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_004_Object_Mesh''' for hidden the Box)''<br />
# diag.setWindowModality(QtCore.Qt.ApplicationModal) # the function has been disabled to promote "WindowStaysOnTopHint"
diag.exec_()


===Sector 5: Units===
def iso8859(encoder):
return unicode(encoder).encode('iso-8859-1')


[[File:Macro_FCInfo_Units_00.png|FCInfo Units]]
def utf8(unio):
return unicode(unio).encode('UTF8')


*{{ComboBox|mm}} : If the object is a face perimeter, length of the object is displayed. Unit size can be selected :<br />km, hm, dam, m, dm, cm, '''mm''', µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.
def heure():
*Length of the object : Length of the object or perimeter of the face {{LineEdit|10.0 mm}}.
return QtCore.QTime().currentTime().toString('hh:mm:ss')
*If the object is a circle, a second lineEdit '''Radius :''' is opened and display the radius and diameter of circle {{LineEdit|2.0 mm (dia. 4.0 mm)}}.
def dateEu():
*Perimeter of the shape (12). Perimeter of the object and number of subObject (Edges) contained in the object {{LineEdit|120.0 mm}}.
return QtCore.QDate().currentDate().toString('dd/MM/yyyy') # forme euro
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_005_Value_Unit''' for hidden the Box)''
def dateUs():
return QtCore.QDate().currentDate().toString('MM/dd/yyyy') # forme us
def dateUk():
return QtCore.QDate().currentDate().toString('yyyy/MM/dd') # forme Uk
def dateComp():
return QtCore.QDate().currentDate().toString('dddd d MMMM yyyy') # Return "dimanche 20 Juillet 2013"


===Sector 6: Inclination===
def degMinSec(angle0):
# give the angle in degrees
global uniteAs
try:
deg = int(angle0)
min = int((angle0 - deg)*60)
sec = round (((((angle0 - deg)*60)-min)*60),6)
angle = str(deg)+u"° "+str(min)+u"' "+str(sec)+u"''"
uniteAs = ""
return angle
except:
return 0


[[File:Macro_FCInfo_Inclination_00.png|FCInfo Inclination]]
def angleGrade(angle0):
# give the angle in degrees
global uniteAs
try:
angle = float(angle0)
angle = (200 * angle) / 180
uniteAs = " gon"
return angle
except:
return 0


*'''Inclination of the object''' can be displayed in:
def angle2(vecteur_x1,vecteur_y1,vecteur_x2,vecteur_y2,mode):
**decimal degree, ex: {{LineEdit|174.831872611°}}
# calculation of the slope of a line using two vectors
**degree minute seconde, ex: {{LineEdit|174° 49' 54.741401''}}
# If 'mode' = 1 then display in degrees or radians
**radian, ex: {{LineEdit|3.05139181449 rad}}
global uniteAs
**grade, ex: {{LineEdit|194.257636235 gon}}
try:
**percent, ex: 30° = {{LineEdit|57.74%}}
deltaX = vecteur_x2 - vecteur_x1
*'''Inclinations in planes XY, YZ, ZX''' and their coordinates
deltaY = vecteur_y2 - vecteur_y1
*'''Direction object''', {{LineEdit|Vector (0.0, 0.0, -10.0)}} give the direction of object. The calculate is : coord_1 - coord_2 = direction (or reverse)
if mode ==1:
**{{Button|Direction}} this button create a line in direction of the object.
angle = degrees(atan2(float(deltaY),float(deltaX))) # degrès
*'''ValueAt(0)''', {{LineEdit|Vector (0.0, 0.0, 10.0)}} returns the 3D vector corresponding to a parameter value.
uniteAs = u"°"
**{{Button|ValueAt(0)}} this button create a line in ValueAt direction of the object.
else:
*'''NormalAt(0,0)''', {{LineEdit|Vector (0.0, 0.0, 1.0)}} returns the 3D vector corresponding to a parameter value.
angle = atan2(float(deltaY),float(deltaX)) # radian
**{{Button|NormalAt(0,0)}} this button create a line in NormalAt direction of the object.
uniteAs = " rad"
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_006_Inclination''' for hidden the Box)''
return angle
except:
return 0
#############################################################
global ui ; ui = ""
global sel ; sel = ""
global document_ ; document_ = "FCInfo"
global object_ ; object_ = ""
global typeObject ; typeObject = ""
global element_ ; element_ = ""
global position0 ; position0 = 0.0
global position1 ; position1 = 0.0
global position2 ; position2 = 0.0
global longueurObjet ; longueurObjet = 0.0
global perimetre ; perimetre = 0.0


===Sector 7: Surface and Volume===
global Plan_xy ; Plan_xy = 0.0
global Plan_xy_V ; Plan_xy_V = ""
global Plan_yz ; Plan_yz = 0.0
global Plan_yz_V ; Plan_yz_V = ""
global Plan_zx ; Plan_zx = 0.0
global Plan_zx_V ; Plan_zx_V = ""


[[File:Macro_FCInfo_Surface_and_Volume_00.png|FCInfo Surface and Volume]]
global surface ; surface = 0.0
global surfaceFace ; surfaceFace = 0.0
global volume_ ; volume_ = 0.0
global densite ; densite = 7.5 # (steel = 7.5 kg by dm3)
global poids ; poids = 0.0
global uniteM ; uniteM = 1.0 # unit of measurement length
global uniteMs ; uniteMs = "mm"
global uniteS ; uniteS = 1.0 # unit of measurement surface
global uniteSs ; uniteSs = u"mm²"
global uniteV ; uniteV = 1.0 # unit of measurement volume
global uniteVs ; uniteVs = u"mm³"
global uniteP ; uniteP = 1.0 # unit of measure weight
global unitePs ; unitePs = "g"
global uniteAs ; uniteAs = u"°"


*Surface of the form displayed, unit size can be selected. {{LineEdit|600.0 mm2}}
global boundBoxCenterX ; boundBoxCenterX = 0.0
*Surface of the face displayed, unit size can be selected. {{LineEdit|0.0 mm2}}
global boundBoxCenterY ; boundBoxCenterY = 0.0
*Volume of the form displayed, unit size can be selected. {{LineEdit|1000.0 mm3}}
global boundBoxCenterZ ; boundBoxCenterZ = 0.0
*Unit , choice your unit.
*The {{ComboBox|gram}} unit mass can be chosen :<br /> ton,quintal, kg, hg, dag, '''gram''', dg, cg, mg, µg, ng, pg, fg, gr (grain), dr (drachm), oz (once), oz t (once troy),<br />lb t (livre troy), lb (livre av), st (stone), qtr (quarter), cwt (hundredweight), tonneau fr, ct.
*Weight of the form displayed, unit mass can be selected. {{LineEdit|2.7 g}}
*Density of the material in '''kg by dm3''' {{LineEdit|2.7000 kg (by dm3)}}
*Material {{ComboBox|Metal Nickel (Ni),8.27,10.0,adapt Price}}
**In beginning the macro search the file '''FCInfo_material.txt''', if the file not exist, one file FCInfo_material.txt is created.
**The file is created with 10 types of material saved in this format.
***'''Title of material , Density on dm3 , Price on dm3 , text info on choice'''
***''(4 fields separate by coma)''
***Liquid Water (H2o),1,10.0,adapt Price
***Mater Beton,2.4,10.0,adapt Price
***Metal Aluminium (Al),2.7,10.0,adapt Price
***Metal Copper (Cu),8.96,10.0,adapt Price
***Metal Gold (Au),19.3,10.0,Gratis
***Metal Iron (Fe),7.87,10.0,adapt Price
***Metal Lead (Pb),11.35,10.0,adapt Price
***Metal Magnesium (Mg),1.43,10.0,adapt Price
***Metal Nickel (Ni),8.27,10.0,adapt Price
***Metal Pewter (Sn),7.29,10.0,adapt Price
***Metal Platinum (Pt),21.45,10.0,adapt Price
***Metal Silver (Ag),10.5,10.0,adapt Price
***Metal Sodium (Na),0.97,10.0,adapt Price
***Metal Titanium (Ti),4.4,10.0,adapt Price
***Metal Zinc (Zn),7.1,10.0,adapt Price
***Wood Beechwood,0.8,10.0,adapt Price
***Wood MDF,0.75,10.0,adapt Price
***Wood Mahogany,0.6,10.0,adapt Price
***Wood Oak,0.7,10.0,adapt Price
***Wood White pine,0.4,10.0,adapt Price
*New material or editing {{LineEdit|Metal Nickel (Ni),8.27,10.0,adapt Price}}
**you can modify or edit one new material in this format:
**'''Title, Density on dm3, Price on dm3, text info on choice'''
**''(4 fields separate by coma)''
**''you can also edit the file in your favorite editor respecting the specific format''
**you can save the file in a path desired with the variable : '''seTMaterialSavePathName'''
**''by default the file is created in the macro path''
**{{Button|Delete 1/17}} : delete the field displayed
**{{Button|Save}} : save the modification or the new material
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_007_Surface_and_Volume''' for hidden the Box)''


===Sector 8: Cost===
global boundBoxCenter; boundBoxCenter= 0.0


[[File:Macro_FCInfo_Cost_00.png|FCInfo Cost]]
global CenterOfMassX ; CenterOfMassX = 0.0
global CenterOfMassY ; CenterOfMassY = 0.0
global CenterOfMassZ ; CenterOfMassZ = 0.0


*Cost total : cost total of the object selected
global boundBox_ ; boundBox_ = 0.0
{{LineEdit|0.027 Eu}}
global boundBoxLX ; boundBoxLX = 0.0
*Price (kg/dm3) : price of the material selected (''Metal Aluminium (Al),2.7,'''''10.0''''',adapt Price'')
global boundBoxLY ; boundBoxLy = 0.0
{{SpinBox|10,0000 Eu (by Kg)}}<br />
global boundBoxLZ ; boundBoxLZ = 0.0
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_008_Cost_And_Price''' for hidden the Box)''
global boundBox_S ; boundBox_S = ""
global MatrixX1 ; MatrixX1 = 0.0
global MatrixY1 ; MatrixY1 = 0.0
global MatrixZ1 ; MatrixZ1 = 0.0
global Matrix_1 ; Matrix_1 = 0.0
global MatrixX2 ; MatrixX2 = 0.0
global MatrixY2 ; MatrixY2 = 0.0
global MatrixZ2 ; MatrixZ2 = 0.0
global Matrix_2 ; Matrix_2 = 0.0
global MatrixX3 ; MatrixX3 = 0.0
global MatrixY3 ; MatrixY3 = 0.0
global MatrixZ3 ; MatrixZ3 = 0.0
global Matrix_3 ; Matrix_3 = 0.0
global Matrix12 ; Matrix12 = 0.0
global Matrix13 ; Matrix13 = 0.0
global Matrix14 ; Matrix14 = 0.0
global Matrix15 ; Matrix15 = 0.0


===Sector 9: BoundBox===
global Vertx ; Vertx = ""
global Edges ; Edges = ""
global ReperEdge ; ReperEdge = 0
global EdgesLong ; EdgesLong = 0.0
global Faces ; Faces = ""
global FacesSurf ; FacesSurf = 0.0
global FacesCoor ; FacesCoor = 0.0
global compt_E ; compt_E = 0
global compt_F ; compt_F = 0
global compt_VF ; compt_VF = 0


[[File:Macro_FCInfo_BoundBox_00.png|FCInfo BoundBox]]
global placement_ ; placement_ = ""
global RowCount ; RowCount = 200
global RowCountTest ; RowCountTest = 0
global path ; path = ""
global SaveName ; SaveName = ""


*BoundBox gives extreme dimensions of the shape.
path = FreeCAD.ConfigGet("AppHomePath")
**maximum X length : {{LineEdit|10.0 mm}}
**maximum Y length : {{LineEdit|10.0 mm}}
**maximum Z length : {{LineEdit|10.0 mm}}
**diagonal length : {{LineEdit|17.3205 mm}}
**{{Button|Tracing}} : create 6 rectangles to dimensions of boundbox
**{{Button|Volume}} : create volume to dimensions of boundbox
**{{CheckBox|Text Dim.}} : create the dimension of the triangle ''(boundbox)''
**If the {{CheckBox|TRUE|Text Dim.}} is checked, the spinbox dimension of text {{SpinBox|3,000}} is operational for give your value ''(3.0 by default)''
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_009_BoundBox''' for hidden the Box)''


===Sector 10: Center of:===
def tableau():
global ui
global sel
global element_
global perimetre
global Vertx
global Edges
global ReperEdge
global EdgesLong
global Faces
global FacesSurf
global FacesCoor
global compt_E
global compt_F
global compt_VF
global RowCount
global RowCountTest
global pas
# tableau
# Vertexes


[[File:Macro_FCInfo_Center_of_00.png|FCInfo Center of...]]
if len(sel) != 0:
Vertx=[]
Edges=[]
Faces=[]
compt_E = 0
compt_F = 0
compt_VF = 0
pas = 0
perimetre = 0.0
EdgesLong = []
for j in enumerate(sel[0].Shape.Edges):
compt_E+=1
Edges.append("Edge%d" % (j[0]+1))
EdgesLong.append(str(sel[0].Shape.Edges[compt_E-1].Length))
perimetre += (sel[0].Shape.Edges[compt_E-1].Length)
a = sel[0].Shape.Edges[compt_E-1].Vertexes[0]
Vertx.append("X1: "+str(a.Point.x))
Vertx.append("Y1: "+str(a.Point.y))
Vertx.append("Z1: "+str(a.Point.z))
if element_ == "Edge%d" % (j[0]+1):
ReperEdge = compt_E
try:
a = sel[0].Shape.Edges[compt_E-1].Vertexes[1]
Vertx.append("X2: "+str(a.Point.x))
Vertx.append("Y2: "+str(a.Point.y))
Vertx.append("Z2: "+str(a.Point.z))
except:
Vertx.append("-")
Vertx.append("-")
Vertx.append("-")
FacesSurf = []
FacesCoor = []
for j in enumerate(sel[0].Shape.Faces):
compt_F+=1
Faces.append("Face%d" % (j[0]+1))
FacesSurf.append(str(sel[0].Shape.Faces[compt_F-1].Area))
fco = 0
for f0 in sel[0].Shape.Faces[compt_F-1].Vertexes: # Vertexes de la face
fco += 1
FacesCoor.append("X"+str(fco)+": "+str(f0.Point.x))
FacesCoor.append("Y"+str(fco)+": "+str(f0.Point.y))
FacesCoor.append("Z"+str(fco)+": "+str(f0.Point.z))
compt_VF += 1
FacesCoor += ("T",)


*Center of the shape and these coordinates XYZ
RowCountTest = compt_E + compt_F + compt_VF
*Center of mass and these coordinates XYZ
*The {{Button|buttons}} creates on point, axis, plane, copy vector axis form '''FreeCAD.Vector(-24.0, 240.0, 7.0)''' ''(see Sector 13)''
def affect():
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_010_Center_Mass''' for hidden the Box)''
global ui
global sel
global document_
global object_
global typeObject
global element_
global position0
global position1
global position2
global longueurObjet


===Sector 11: Inertia===
global ReperEdge
global Plan_xy
global Plan_xy_V
global Plan_yz
global Plan_yz_V
global Plan_zx
global Plan_zx_V


[[File:Macro_FCInfo_Inertia_00.png|FCInfo Inertia]]
global surface
global surfaceFace
global volume_
global densite
global poids
global uniteM
global uniteMs
global uniteS
global uniteSs
global uniteV
global uniteVs
global uniteP
global unitePs
global uniteAs


*Moment of inertia and these coordinates length and weigth
global boundBoxCenterX
*The button creates on point, axis, plane, copy vector axis form '''FreeCAD.Vector(-24.0, 240.0, 7.0)''' ''(see Sector 13)''
global boundBoxCenterY
** action line 1 : {{LineEdit|x1}}, {{LineEdit|y1}}, {{LineEdit|z1}}, {{LineEdit|0.0}}
global boundBoxCenterZ
** action line 2 : {{LineEdit|x2}}, {{LineEdit|y2}}, {{LineEdit|z2}}, {{LineEdit|0.0}}
** action line 3 : {{LineEdit|x3}}, {{LineEdit|y3}}, {{LineEdit|z3}}, {{LineEdit|0.0}}
** action 4 diagonal : {{LineEdit|x1}}, {{LineEdit|y2}}, {{LineEdit|z3}}
same for length and weigth
*Determinant 1 : {{LineEdit|4629629629629.633}} computes the determinant of the matrix, in [https://en.wikipedia.org/wiki/Scientific_notation scientific value]
*Determinant 2 : {{LineEdit|4629629629629.6328125}} computes the determinant of the matrix, in decimal value
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_011_Inertia''' for hidden the Box)''


===Sector 12: SpreadSheet===
global boundBoxCenter


[[File:Macro_FCInfo_Disabled_module_00.png|FCInfo Disabled]]
global CenterOfMassX
global CenterOfMassY
global CenterOfMassZ


*{{CheckBox|Disabled module}} CheckBox for search or not all details of the object. If it is not checked, only the principal value is displayed.
global boundBox_
*Vertexes and details of the shape (compt_Edge), (compt_Faces), (compt_Vector of the Face)
global boundBoxLX
*Max 200 lines in the table, if there are more than 200 lines it appears '''(!+ 200)''' and the number of lines
global boundBoxLY
*If the object is complicated with many objects, the time is long and the search is repeated with every mouse click. The write function in the spreadSheet included, decreases the display time for this it is disabled by default
global boundBoxLZ
*Full details can save be the {{Button|Save}} button in a file in CSV format and can be viewed the file in spreadsheet with the {{Button|Read}} or by an external spreadsheet as [https://www.libreoffice.org/ LibreOffice] [http://openoffice.apache.org/downloads.html OpenOffice] or other<br/>
global boundBox_S
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_012_SpreadSheet''' for hidden the Box)''
global MatrixX1
global MatrixY1
global MatrixZ1
global Matrix_1
global MatrixX2
global MatrixY2
global MatrixZ2
global Matrix_2
global MatrixX3
global MatrixY3
global MatrixZ3
global Matrix_3
global Matrix12
global Matrix13
global Matrix14
global Matrix15


===Sector 13: SpreadSheet creation===
global placement_
global SaveName


[[File:Macro_FCInfo_SpreedSheet_00.png|FCInfo SpreedSheet]]
global FacesSurf
global EdgesLong
global FacesCoor


*{{Button|SpreadSheet}} : create a new spreadsheet in a document
try:
*{{LineEdit|SpreadSheet}} : the current spreadsheet. if the spreadsheet does not exist one spreadsheet is created
atest = sel[0].Shape.Vertexes
*{{Button|Refresh}} : refresh the list of spreadsheet in document
except:
*{{ComboBox|-}} : the spreadsheet(s) present in document
App.Console.PrintMessage("Invalid selection"+"\n")
*{{Button|Read}} : read the data in a spreadsheet saved '''.FCInfo''' or txt, asc, csv
errorDialog("Invalid selection")
*{{Button|Save}} : save the data in disk in the form selected below '''.FCInfo''' or txt, asc, csv
sel = ""
*{{RadioButton|TRUE|Tabulation}} : the separator is Tabulation (by default)
else:
*{{RadioButton|Comma}} : the separator is Comma
sel = FreeCADGui.Selection.getSelection()
*{{RadioButton|Semicolon}} : the separator is Semicolon
mydoc = FreeCAD.activeDocument().Name
*{{RadioButton|Space}} : the separator is Space
document_ = mydoc


<div class="mw-translate-fuzzy">
try:
Možnost uložit nebo přečíst tabulku s různým oddělovačem, tabulka, čárka, středník, prostor <br />
object_ = sel[0].Label
Tabulace jsou oddělovač pro modul FreeCAD spreadSheet <br />
except:
Počet těchto čtyř oddělovačů se vypočítá pro pomoc, pokud není známo <br />
object_ = ""
COMMA jsou starý (01.16 a dřívější) oddělovač maker FCInfo <br />
Nyní pro kompatibilitu s rozložením FreeCAD spreadSheet a od verze 01.17 je TABULACE implicitně oddělovač <br />
Chcete-li převést vaši starou tabulku FCInfo: Otevřete ji ve složce FCInfo a uložte ji pomocí možnosti Tabulace
</div>


===Sector 14: Main tools===
try:
SubElement = FreeCADGui.Selection.getSelectionEx()
element_ = SubElement[0].SubElementNames[0]
except:
element_ = ""


[[File:Macro_FCInfo_Main_00.png|FCInfo Main]]
# longueur Objet
try:
longueurObjet = Gui.Selection.getSelectionEx()[0].SubObjects[0].Length
except:
longueurObjet = 0.0


*{{CheckBox|Info}} : if this CheckBox is checked, the informations are displayed in the report view window
# tableau
*{{CheckBox|Point}} : if checked, one point is created in the coordinate displayed form : '''FreeCAD.Vector(-24.0, 240.0, 7.0)'''
tableau()
*{{CheckBox|Axis}} : if checked, one axis is created in the coordinate displayed form : '''FreeCAD.Vector(-24.0, 240.0, 7.0)'''
*{{CheckBox|Plane}} : if checked, one axis plane is created in the coordinate displayed form : '''FreeCAD.Vector(-24.0, 240.0, 7.0)'''
*{{RadioButton|Clip-B0}} : None clipBoard
*{{RadioButton|Clip-B1}} : If checked the coordinate are copy in the clipBoard Form : '''FreeCAD.Vector(X.0, Y.0, Z.0)''' FreeCAD model
*{{RadioButton|Clip-B2}} : If checked the coordinate are copy in the clipBoard Form : '''X, Y, Z''' with Comma separator
*{{RadioButton|Clip-B3}} : If checked the coordinate are copy in the clipBoard Form : '''X Y Z''' as is with Space separator
*{{CheckBox|Left/Right}} : if this CheckBox is not checked, the window macro are displayed to right (default). If it is checked the window macro are displayed to left.<br> If the option is 1 mode fly ''(User parameter:BaseApp/Preferences/Macros/FCMmacros/FCInfo/'''seTPositionFlyRightLeft''')'' this button is not visible .
*{{SpinBox|4 (Decimales)}} : give the number of decimal displayed
*{{SpinBox|12 (Dim. texte)}} : give the dimensionof text in the macro
*{{Button|Forum}} : direction FCInfo forum tread ''(you must to be connected to internet)''
*{{Button|Wiki}} : direction Wiki FCInfo ''(you must to be connected to internet)''
*{{Button|Ref}} : refresh the display of data in report view
*{{Button|Exit}} : exit properly the macro ''(not use the red cross of the window)''
''(you can checked to {{false}} the variable '''switch_setVisible_GBox_014_Main_Tools''' for hidden the Box)''


<div class="mw-translate-fuzzy">
# surface
Po spuštění makra zůstane makro aktivní a okno zůstane viditelné. Chcete-li makro ukončit, stiskněte klávesu {{KEY|Exit}}. Pokud opustíte kříž, makro zůstane v paměti a data se objeví v zobrazení "sestavy" aplikace FreeCAD.
try:
</div>
surface = sel[0].Shape.Area
except:
surface = 0.0


<div class="mw-translate-fuzzy">
try:
<center>
surfaceFace = Gui.Selection.getSelectionEx()[0].SubObjects[0].Area
<gallery widths="400" heights="200">
except:
Image:Macro_FCInfo_04.png|Zakotveno vpravo,
surfaceFace = 0.0
Image:Macro FCInfo 05.png|nebo ponecháno v zobrazení Combo a dosažitelné pomocí karty, nebo není zakotveno k výběru.
</gallery>
</center>
{{clear}}
</div>


==Options==
# volume
try:
volume_ = sel[0].Shape.Volume
except:
volume_ = 0.0


<span id="The_unit_used"></span>
# densité
<div class="mw-translate-fuzzy">
poids = ((volume_ * densite) * uniteP) / 1000 # mm3 (mm base FreeCAD)
==Volby==
===Použité jednotky===
====Délková jednotka:====
km, hm, dam, m, dm, cm, '''mm''', µm, nm, pm, fm, inch(palec), link, foot(stopa), yard, perch, chain, furlong, mile, league, nautique.
</div>


====Length unit:====
# boundinbox (dimensions hors tout)
try:
boundBox_ = sel[0].Shape.BoundBox
boundBoxLX = boundBox_.XLength
boundBoxLY = boundBox_.YLength
boundBoxLZ = boundBox_.ZLength
boundBox_S = "[X: "+str(boundBoxLX * uniteM)+" "+uniteMs+"] x [Y: "+str(boundBoxLY * uniteM)+" "+uniteMs+"] x [Z:"+str(boundBoxLZ * uniteM)+" "+uniteMs+"]"
except:
boundBox_ = 0.0
boundBoxLX = 0.0
boundBoxLY = 0.0
boundBoxLZ = 0.0
boundBox_S = ""


km, hm, dam, m, dm, cm, '''mm''', µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.
# centre de la forme
try:
boundBoxCenterX = boundBox_.Center[0]
boundBoxCenterY = boundBox_.Center[1]
boundBoxCenterZ = boundBox_.Center[2]
except:
boundBoxCenterX = 0.0
boundBoxCenterY = 0.0
boundBoxCenterZ = 0.0


====Angle degrees :====
# Inclinaison
mode = 1
try:
Plan_xy = angle2(sel[0].Shape.Vertexes[ReperEdge-1].Point[0],sel[0].Shape.Vertexes[ReperEdge-1].Point[1],sel[0].Shape.Vertexes[ReperEdge].Point[0],sel[0].Shape.Vertexes[ReperEdge].Point[1],mode)
Plan_xy_V = "[,"+str(sel[0].Shape.Vertexes[ReperEdge-1].Point[0])+" , "+str(sel[0].Shape.Vertexes[ReperEdge-1].Point[1])+",] [,"+str(sel[0].Shape.Vertexes[ReperEdge].Point[0])+" , "+str(sel[0].Shape.Vertexes[ReperEdge].Point[1])+",]"
except:
Plan_xy = 0.0
Plan_xy_V = ""
try:
Plan_yz = angle2(sel[0].Shape.Vertexes[ReperEdge-1].Point[1],sel[0].Shape.Vertexes[ReperEdge-1].Point[2],sel[0].Shape.Vertexes[ReperEdge].Point[1],sel[0].Shape.Vertexes[ReperEdge].Point[2],mode)
Plan_yz_V = "[,"+str(sel[0].Shape.Vertexes[ReperEdge-1].Point[1])+" , "+str(sel[0].Shape.Vertexes[ReperEdge-1].Point[2])+",] [,"+str(sel[0].Shape.Vertexes[ReperEdge].Point[1])+" , "+str(sel[0].Shape.Vertexes[ReperEdge].Point[2])+",]"
except:
Plan_yz = 0.0
Plan_yz_V = ""
try:
Plan_zx = angle2(sel[0].Shape.Vertexes[ReperEdge-1].Point[2],sel[0].Shape.Vertexes[ReperEdge-1].Point[0],sel[0].Shape.Vertexes[ReperEdge].Point[2],sel[0].Shape.Vertexes[ReperEdge].Point[0],mode)
Plan_zx_V = "[,"+str(sel[0].Shape.Vertexes[ReperEdge-1].Point[2])+" , "+str(sel[0].Shape.Vertexes[ReperEdge-1].Point[0])+",] [,"+str(sel[0].Shape.Vertexes[ReperEdge].Point[2])+" , "+str(sel[0].Shape.Vertexes[ReperEdge].Point[0])+",]"
except:
Plan_zx = 0.0
Plan_zx_V = ""


<div class="mw-translate-fuzzy">
# # Placement
====Úhlové stupně :====
# placement_ = sel[0].Shape.Placement
#'''dekadické stupně''', např: 174.831872611°
# App.Console.PrintMessage(placement_+"\n")
#stupně minuty vteřiny, např.:<nowiki> 174° 49' 54.741401''</nowiki>
#radiány, např.: 3.05139181449 rad
#grade, např.: 194.257636235 gon
#procenta např.: 30° = 57.74%
</div>


<div class="mw-translate-fuzzy">
try:
Understanding of angles in FCInfo display.
typeObject = sel[0].Shape.ShapeType
except:
<center>
App.Console.PrintMessage("Error type object"+"\n")
<gallery widths="400" heights="200">
typeObject = ""
Image:Macro FCInfo 02.png|Understanding of angles in FCInfo display
Image:Macro FCInfo 03.gif|Understanding of angles in poucent in FCInfo display <br /> click twice to see the animation (the image must be in full screen)
</gallery>
</center>
{{clear}}
</div>


<center>
selEx = FreeCADGui.Selection.getSelectionEx()
<gallery widths="400" heights="200">
objs = [selobj.Object for selobj in selEx]
s = objs[0].Shape


Image:Macro FCInfo 02.png|Understanding of angles in FCInfo display
# center of mass
Image:Macro FCInfo 03.gif|Understanding of angles in percent in FCInfo display <br /> click twice to see the animation (the image must be in full screen)
try:
c = s.Solids[0].CenterOfMass
CenterOfMassX = c.x
CenterOfMassY = c.y
CenterOfMassZ = c.z
except:
CenterOfMassX = 0.0
CenterOfMassY = 0.0
CenterOfMassZ = 0.0


</gallery>
# inertia
</center>
try:
{{clear}}
m = s.Solids[0].MatrixOfInertia
MatrixX1 = (m.A[0])
MatrixY1 = (m.A[1])
MatrixZ1 = (m.A[2])
Matrix_1 = (m.A[3])


====Weight unit :====
MatrixX2 = (m.A[4])
MatrixY2 = (m.A[5])
MatrixZ2 = (m.A[6])
Matrix_2 = (m.A[7])


<div class="mw-translate-fuzzy">
MatrixX3 = (m.A[8])
====Váhové jednotky :====
MatrixY3 = (m.A[9])
ton, quintal, kg, hg, dag, '''gram''', dg, cg, mg, µg, ng, pg, fg, gr (grain), dr (drachm), oz (once), oz t (once troy),<br />
MatrixZ3 = (m.A[10])
lb t (livre troy), lb (livre av), st (stone), qtr (quarter), cwt (hundredweight), tonneau fr, ct <br />
Matrix_3 = (m.A[11])
"spinBox" je nastaven na '''7,5''' kg, tj. průměrná měrná hmotnost oceli. Chcete-li jinou defaultní (přednastavenou) hodnotu, změňte hodnotu měrné hmotnosti na řádku 208
</div>


====FCInfo Configuration====
Matrix12 = (m.A[12])
Matrix13 = (m.A[13])
Matrix14 = (m.A[14])
Matrix15 = (m.A[15])
except:
MatrixX1 = 0.0
MatrixY1 = 0.0
MatrixZ1 = 0.0
Matrix_1 = 0.0


*Location : '''Tools > Edit parameter > *User parameter:BaseApp/Preferences/Macros/FCMmacros/FCInfo/'''
MatrixX2 = 0.0
*'''switchNotInfoOnBeginning''' '''#''' SetBool {{true}} or [{{false}}]
MatrixY2 = 0.0
**Display or not this text information on run macro
MatrixZ2 = 0.0
***[{{false}}] = display this information
Matrix_2 = 0.0
*** {{true}} = this Information is Not displayed On Beginning
*'''switchVersionSearch''' '''#''' SetBool {{true}} or [{{false}}]
**Search if one new version exist on run macro
*'''switchWarning''' '''#''' SetBool {{true}} or [{{false}}]
**Display or not display the window warning in case not good selection
*'''switchCreatePoint''' '''#''' SetBool {{true}} or [{{false}}]
**Check the Create point checkBox
*'''switchCreateAxis''' '''#''' SetBool {{true}} or [{{false}}]
**Check the Create axis checkBox
*'''switchCreatePlane''' '''#''' SetBool {{true}} or [{{false}}]
**Check the Create plane checkBox
*'''switchDisplayInfoObject''' '''#''' SetBool {{true}} or [{{false}}]
**Check the info checkBox
*'''switchClearDisplayReportView''' '''#''' SetBool {{true}} or [{{false}}]
**if switchClearDisplayReportView is {{true}} the ReportView is cleared
*'''seTWidgetPosition''' '''#''' SetBool {{true}} or [{{false}}]
**Check the Widget Position Left/Right checkBox
**if seTWidgetPosition [{{false}}] : if seTPositionFlyRightLeft = 2 = docked to Right
**if seTWidgetPosition {{true}} : if seTPositionFlyRightLeft = 3 = docked to Left
**if it is 1 the window macro is not docked
*'''switchBoundBoxCreateText''' '''#''' SetBool {{true}} or [{{false}}]
**Create the text dimension of the BoundBox
*'''seTBoundBoxTextHeigth''' '''#''' seTBoundBoxTextHeigth = 3.0
**Give the Heigth of the text dimension (independent of the seTTextHeigthValue)
*'''seTBoundBoxTextArround''' '''#''' seTBoundBoxTextArround = 3
**Give the arround of the text dimensions (independent of the seTDecimalValue)
*'''seTMemoClipBoard''' '''#''' SetInt [0], 1, 2, 3
**Give one value [0], 1, 2, 3 clipBoard
***[0] = desactivate the clipBoard
*** 1 = the data string is memorised to : FreeCAD.Vector( X, Y, Z )
*** 2 = the data string is memorised to : X, Y, Z
*** 3 = the data string is memorised to : X Y Z
*'''seTTextHeigthValue''' '''#''' SetInt 11
**Give one text heigth value of the macro
*'''seTDecimalValue''' '''#''' SetInt 4
**Give the number of decimal displayed
**If the number is -1 the total decimal value is displayed)
*'''seTMaterialCurrentIndex''' '''#''' SetInt 0
**Set the index of the ComboBox
*'''seTMaterialFileName''' '''#''' SetString FCInfo_material.txt
**Name of the material file
*'''seTMaterialSavePathName''' '''#''' SetString C:\...\Macro\FCInfo_material.txt
**Path name of the material file
*'''seTMaterialPrice''' '''#''' SetFloat
**Material price by Kg
*'''seTMaterialSuffixDevise''' '''#''' SetString
**Devise money
*'''seTMaterialSuffixCost''' '''#''' seTMaterialSuffixCost
**Suffix Devise cost
*'''seTMaterialCost''' '''#''' SetFloat
**Material cost
*'''seTDensiteValue''' '''#''' SetFloat 1.0
**Give the densite value
*'''seTDensiteDecimalNumber''' '''#''' SetInt 4
**Give the number of decimal for the densite value
*'''seTDensiteSingleStep''' '''#''' SetFloat 1.0
**Give the step for one click, by default 1.0 (possible 0.01 or ...)
*'''seTDensiteSuffixChain''' '''#''' SetString kg (by dm3)
**Choice your suffix string
*'''seTPositionFlyRightLeft''' '''#''' SetInt 2
**Choice your position, Fly, [Right], Left
*** 1 = the macro window is fly (not docked)
***[2] = the macro window is positioned to Right
*** 3 or other = the macro window is positioned to Left
*'''seTIndexUnitWeight''' '''#''' SetInt
**Set unit Weight index
*'''seTUnitSymbolMicro''' '''#''' U
**Set Symbol Micro
*'''seTUnitSymbolCube''' '''#''' 3
**Set Symbol Cube
*'''seTUnitSymbolCarre''' '''#''' 2
**Set Symbol Square
*'''seTIndexUnitLength''' '''#''' SetInt
**Set unit Length index
*'''setBSplineToByArcValue''' '''#''' SetFloat 0.00001
**Set unit for cut the BSpline for seack the radius on point given
*'''setMeshTopologyValue''' '''#''' SetFloat 0.1
**Set unit for create the Mesh to Shape
*'''switchBSplineCreateCircleConstructorAxis''' '''#'''SetBool {{true}} or [{{false}}]
**Display the axis of the circles (arcs) for create the BSpline
*'''switchBSplineCreateCircleConstructor''' '''#'''SetBool {{true}} or [{{false}}]
**Display the circles cretors for create the BSpline
*'''switchCreateLineDiVatNatOnClick''' '''#'''SetBool {{true}} or [{{false}}]
**Create the Line info on point (0,0,0) or on point mouse clicked (x,y,z) if it is {{true}}
**If it is {{true}} one '*' is displayed in front of text. EX: '*Direction'


MatrixX3 = 0.0
MatrixY3 = 0.0
MatrixZ3 = 0.0
Matrix_3 = 0.0


This switch ''(section GroupBox)'' allows you to view only the desired section(s) (just visual) {{False}} or {{True}}.
Matrix12 = 0.0
Matrix13 = 0.0
Matrix14 = 0.0
Matrix15 = 0.0


All calculations are done without taking account of this option
########################################################
App.Console.PrintMessage("Beginning___________________________________________________________________"+"\n")
App.Console.PrintMessage("Document name : "+document_+"\n")
App.Console.PrintMessage("Object name : "+object_+"\n")
App.Console.PrintMessage("Object type : "+typeObject+"\n")
App.Console.PrintMessage("Element name : "+str(element_)+"\n")
App.Console.PrintMessage("Mouse coordinates : X: "+str(position0)+", Y: "+str(position1)+", Z: "+str(position2)+"\n")
App.Console.PrintMessage("Length of the object : "+str(longueurObjet * uniteM)+", "+uniteMs+"\n")
App.Console.PrintMessage("Perimeter of the shape : "+str(perimetre * uniteM)+", "+uniteMs+"\n\n")
App.Console.PrintMessage("Vertexes and details : ("+ str(compt_E) +") ("+ str(compt_F)+") ("+ str(compt_VF)+") ("+str(RowCountTest)+")\n")
co = 0
aa = 0
for j in enumerate(Edges):
App.Console.PrintMessage(str(j[1])+" = "+str(float(EdgesLong[co]) * float(uniteM))+" "+uniteMs+"\n")
try:
for a in range(aa,aa+6):
App.Console.PrintMessage(Vertx[a]+"\n")
except:
None
co += 1
aa += 6
App.Console.PrintMessage("\n")
co=0
cco=0
for j in enumerate(Faces):
App.Console.PrintMessage(str(j[1])+" = "+str(float(FacesSurf[co]) * float(uniteS))+" "+uniteSs+"\n")
for jj in range(cco,len(FacesCoor)):
cco+=1
if FacesCoor[jj] == "T":
break
else:
App.Console.PrintMessage(FacesCoor[jj]+"\n")
App.Console.PrintMessage("\n")
co += 1
cco=0
App.Console.PrintMessage("Plan : XY: " + str(Plan_xy)+uniteAs+" coordinates: " + str(Plan_xy_V)+"\n")
App.Console.PrintMessage("Plan : YZ: " + str(Plan_yz)+uniteAs+" coordinates: " + str(Plan_yz_V)+"\n")
App.Console.PrintMessage("Plan : ZX: " + str(Plan_zx)+uniteAs+" coordinates: " + str(Plan_zx_V)+"\n\n")
App.Console.PrintMessage("The form surface : "+str(surface * uniteS)+" "+uniteSs+"\n")
App.Console.PrintMessage("The face surface : "+str(surfaceFace * uniteS)+" "+uniteSs+"\n\n")
App.Console.PrintMessage("Volume of the form : "+str(volume_ * uniteV)+" "+uniteVs+"\n")
App.Console.PrintMessage("Weight : "+str(poids)+" "+unitePs+" (Density : "+str(densite)+")\n\n")
App.Console.PrintMessage("Center of the shape : X: "+str(boundBoxCenterX)+" Y: "+str(boundBoxCenterY)+" Z: "+str(boundBoxCenterZ)+"\n")
App.Console.PrintMessage("Center of mass : X: "+str(CenterOfMassX) +" Y: "+str(CenterOfMassY) +" Z: "+str(CenterOfMassZ)+"\n")
App.Console.PrintMessage("Overall dimensions : "+boundBox_S+"\n\n")
App.Console.PrintMessage("Matrix of inertia : X: "+str(MatrixX1)+" Y: "+str(MatrixY1)+" Z: "+str(MatrixZ1)+" : "+str(Matrix_1)+"\n")
App.Console.PrintMessage(" : X: "+str(MatrixX2)+" Y: "+str(MatrixY2)+" Z: "+str(MatrixZ2)+" : "+str(Matrix_2)+"\n")
App.Console.PrintMessage(" : X: "+str(MatrixX3)+" Y: "+str(MatrixY3)+" Z: "+str(MatrixZ3)+" : "+str(Matrix_3)+"\n")
App.Console.PrintMessage(" : X: "+str(Matrix12)+" Y: "+str(Matrix13)+" Z: "+str(Matrix14)+" : "+str(Matrix15)+"\n")
App.Console.PrintMessage("End_"+str(element_)+"____________________________________________________________"+"\n")
####################################
class Ui_MainWindow(object):


* section GroupBox begin
def __init__(self, MainWindow):
**'''switch_setVisible_GBox_001_Document''' = True (1)
global ui
**'''switch_setVisible_GBox_002_Coordinate_Mouse''' = True (1)
global sel
**'''switch_setVisible_GBox_003_Color''' = True (1)
global document_
**'''switch_setVisible_GBox_004_Object_Mesh''' = True (1)
global object_
**'''switch_setVisible_GBox_005_Value_Unit''' = True (1)
global typeObject
**'''switch_setVisible_GBox_006_Inclination''' = True (1)
global element_
**'''switch_setVisible_GBox_007_Surface_and_Volume''' = True (1)
global position0
**'''switch_setVisible_GBox_008_Cost_And_Price''' = True (1)
global position1
**'''switch_setVisible_GBox_009_BoundBox''' = True (1)
global position2
**'''switch_setVisible_GBox_010_Center_Mass''' = True (1)
global longueurObjet
**'''switch_setVisible_GBox_011_Inertia''' = True (1)
global perimetre
**'''switch_setVisible_GBox_012_SpreadSheet''' = True (1)
global Plan_xy
**'''switch_setVisible_GBox_013_SpreadSheet_Creation''' = True (1)
global Plan_xy_V
**'''switch_setVisible_GBox_014_Main_Tools''' = True (1)
global Plan_yz
* section GroupBox end
global Plan_yz_V
global Plan_zx
global Plan_zx_V
global surface
global surfaceFace
global volume_
global densite
global poids
global uniteM
global uniteMs
global uniteS
global uniteSs
global uniteV
global uniteVs
global uniteP
global unitePs
global uniteAs
global boundBoxCenterX
global boundBoxCenterY
global boundBoxCenterZ
global boundBoxCenter
global CenterOfMassX
global CenterOfMassY
global CenterOfMassZ
global boundBox_
global boundBoxLX
global boundBoxLY
global boundBoxLZ
global boundBox_S


<span id="Script"></span>
global MatrixX1
<div class="mw-translate-fuzzy">
global MatrixY1
===Skript===
global MatrixZ1
Zkopírujte obsah tohoto makra do souboru nazvaného "FCInfo.FCMacro" (ve Windowsech) do "C:\Program Files\FreeCAD0.13".<br />
global Matrix_1
Nebo přímo do okna FreeCADu <br />
Ikona musí být ve stejném adresáři jako je makro pro Windows "C:\Program Files\FreeCAD0.13".<br />
Stáhněte umístění obrázků u ikon [[File:FCInfo.png|64px]] [[File:FCInfoSpreadsheet.png|64px]] a pravým tlačítkem je "Uložte jako" (neměňte jméno) (originál - Download image positioning on the icon [[File:FCInfo.png|64px]] [[File:FCInfoSpreadsheet.png|64px]] and then drag the mouse right click "save as" (do not change the name)) <br />
</div>


Copy the contents of the macro in a file named "FCInfo.FCMacro"
global MatrixX2
*Windows: the form is usually '''" drive:\Users\your_user_name\AppData\Roaming\FreeCAD\ "'''
global MatrixY2
*Ubuntu: the form is usually '''" /home/your_user_name/.FreeCAD "'''.<br />
global MatrixZ2
Or, directly in the interface of FreeCAD <br />
global Matrix_2
The icon must be in the same directory as the macro.<br />
Download image positioning on the icon [[File:FCInfo.png|64px]] [[File:FCInfoSpreadsheet.png|64px]] and then drag the mouse right click "save as" (do not change the name)<br />


<div class="mw-translate-fuzzy">
global MatrixX3
'''PS: příliš dlouhá na to, aby byla obsažena na stránce wiki (zatím jsou stránky wiki pouze 64 KB) kód makra byl umístěn na fóru''' <br /> <br />
global MatrixY3
</div>
global MatrixZ3
global Matrix_3


<div class="mw-translate-fuzzy">
global Matrix12
Stáhněte soubor makra na podstavec '''ukotvený vpravo'''
global Matrix13
</div>
global Matrix14
global Matrix15
global Vertx
global Edges
global EdgesLong
global Faces
global FacesSurf
global FacesCoor
global compt_E
global compt_F
global compt_VF
global placement_
global RowCount
global RowCountTest


<div class="mw-translate-fuzzy">
self.window = MainWindow
{{CodeDownload|https://gist.github.com/mario52a/8d40ab6c018c2bde678f|last version Macro_FCInfo and the icons at the end of the page}}
MainWindow.setObjectName(_fromUtf8("MainWindow"))
</div>
MainWindow.resize(370, 695)
MainWindow.setMinimumSize(QtCore.QSize(370, 695))
MainWindow.setMaximumSize(QtCore.QSize(370, 695))
self.centralWidget = QtGui.QWidget(MainWindow)
self.centralWidget.setMinimumSize(QtCore.QSize(370, 695)) # dimensions min fenetre
self.centralWidget.setMaximumSize(QtCore.QSize(370, 695)) # dimensions max fenetre
self.centralWidget.setBaseSize(QtCore.QSize(0, 0))
self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
self.scrollArea = QtGui.QScrollArea(self.centralWidget)
self.scrollArea.setGeometry(QtCore.QRect(5, 5, 360, 640))
self.scrollArea.setMaximumSize(QtCore.QSize(360, 890))
self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName(_fromUtf8("scrollArea"))


<div class="mw-translate-fuzzy">
self.scrollAreaWidgetContents_2 = QtGui.QWidget()
(Nebo '''[http://forum.freecadweb.org/viewtopic.php?f=10&t=3185&p=47748#p47748 On the forum.]''') <br /> <br />
self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 335, 890))
'''PS:''' toto makro používá '''getSelection ()''' a seznam objektů začíná na 1 ex: pro pole '' 'Edge1 to Edge12'
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
a kód v konzole začíná na 0 ex: pro rámeček '''Edge [0] na Edge [11]''' <br />
sizePolicy.setHorizontalStretch(0)
To je normální počítání na matici / seznamy uvnitř OpenCascade vždy začíná na '''1 a ne na 0'''
sizePolicy.setVerticalStretch(0)
</div>
sizePolicy.setHeightForWidth(self.scrollAreaWidgetContents_2.sizePolicy().hasHeightForWidth())
self.scrollAreaWidgetContents_2.setSizePolicy(sizePolicy)
self.scrollAreaWidgetContents_2.setMinimumSize(QtCore.QSize(335, 900))
self.scrollAreaWidgetContents_2.setObjectName(_fromUtf8("scrollAreaWidgetContents_2"))


===Limitations===
MainWindow.setWindowModality(QtCore.Qt.NonModal)
MainWindow.setFocusPolicy(QtCore.Qt.NoFocus)
MainWindow.setIconSize(QtCore.QSize(30, 30))
MainWindow.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
MainWindow.setDocumentMode(True)
MainWindow.setTabShape(QtGui.QTabWidget.Triangular)
MainWindow.setDockOptions(QtGui.QMainWindow.AllowTabbedDocks|QtGui.QMainWindow.AnimatedDocks|QtGui.QMainWindow.VerticalTabs)


<div class="mw-translate-fuzzy">
sel = FreeCADGui.Selection.getSelection()
===Omezení===
if len(sel)==0:
Pro ukončení vždy používejte tlačítko {{KEY|Exit}}. Ukončení jiným způsobem zapříčiní, že program zůstane v paměti a běží a zobrazuje data v "reportovacím pohledu". Abyste uvolnili pamět, musíte ukončit celý FreeCAD.<br />
App.Console.PrintMessage("Select an object"+"\n")
V tabulce je viditelných pouze prvních 200 prvků objektu. Je-li jich v objektu více zobrazí se upozornění "'(! +200)" '. Kompletní seznam dat je viditelný v souboru uloženém pomocí tlačítka {{KEY|Save}}.<br />
errorDialog("Select an object")
</div>
else:
affect()
###################################################
# # Placement
# placement_ = sel[0].Shape.Placement
# App.Console.PrintMessage(placement_+"\n")
###################################################
self.lineEdit_1 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_1.setGeometry(QtCore.QRect(120, 10, 211, 22))
self.lineEdit_1.setObjectName(_fromUtf8("lineEdit_1"))
self.lineEdit_1.setText(document_)
self.lineEdit_1.setToolTip(_translate("MainWindow", "Name of the active document.", None))


<div class="mw-translate-fuzzy">
self.lineEdit_2 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
Pokud je makro okna po spuštění neviditelné, podívejte se do dolního okna:
self.lineEdit_2.setGeometry(QtCore.QRect(120, 40, 101, 22))
</div>
self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
self.lineEdit_2.setText(object_)
self.lineEdit_2.setToolTip(_translate("MainWindow","Name of the selected object.", None))


[[File:Macro FCInfo_08.png]]
self.lineEdit_2a = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_2a.setGeometry(QtCore.QRect(230, 40, 101, 22))
self.lineEdit_2a.setObjectName(_fromUtf8("lineEdit_2a"))
self.lineEdit_2a.setText(typeObject)
self.lineEdit_2a.setToolTip(_translate("MainWindow","Object type.", None))


self.lineEdit_3 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_3.setGeometry(QtCore.QRect(120, 70, 211, 22))
self.lineEdit_3.setObjectName(_fromUtf8("lineEdit_3"))
self.lineEdit_3.setText(str(element_))
self.lineEdit_3.setToolTip(_translate("MainWindow","Name of the selected object.", None))


[[File:FCInfo_begin_00.gif]]
self.lineEdit_4x = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
{{clear}}
self.lineEdit_4x.setGeometry(QtCore.QRect(10, 140, 101, 22))
self.lineEdit_4x.setObjectName(_fromUtf8("lineEdit_4x"))
self.lineEdit_4x.setText(str(position0))
self.lineEdit_4x.setToolTip(_translate("MainWindow","X coordinate of the click of the mouse.", None))


<div class="mw-translate-fuzzy">
self.lineEdit_4y = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
projekt: <br />
self.lineEdit_4y.setGeometry(QtCore.QRect(120, 140, 101, 22))
<strike> si přečtěte soubor přímo v tabulce. </strike> provedeno <br />
self.lineEdit_4y.setObjectName(_fromUtf8("lineEdit_4y"))
<strike> odpovídá okraji a jejich souřadnic </strike>, které byly provedeny <br />
self.lineEdit_4y.setText(str(position1))
Sdružení látky s její hustotou <br />
self.lineEdit_4y.setToolTip(_translate("MainWindow","Y coordinate of the click of the mouse.", None))
<strike> sklon k prvku spíše než globální objekt </strike> proveden <br />
<strike> vložte přímo do rozhraní FreeCADu </strike> do <br />
</div>


==Version==
self.lineEdit_4z = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_4z.setGeometry(QtCore.QRect(230, 140, 101, 22))
self.lineEdit_4z.setObjectName(_fromUtf8("lineEdit_4z"))
self.lineEdit_4z.setText(str(position2))
self.lineEdit_4z.setToolTip(_translate("MainWindow","Z coordinate of the click of the mouse.", None))


ver 1.28b 1.28c 2023/10/30 orthographe
self.lineEdit_5 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_5.setGeometry(QtCore.QRect(120, 170, 211, 22))
self.lineEdit_5.setObjectName(_fromUtf8("lineEdit_5"))
self.lineEdit_5.setText(str(longueurObjet))
self.lineEdit_5.setToolTip(_translate("MainWindow","Length of the object. \nIf one side is selected the perimeter of the face will be displayed.", None))


ver 1.28 01/09/2023 modify variable name, possibility hidden each sector, save data spreadSheet in document, surface radius, add button webWiki and webForum
self.lineEdit_6 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_6.setGeometry(QtCore.QRect(120, 200, 211, 22))
self.lineEdit_6.setObjectName(_fromUtf8("lineEdit_6"))
self.lineEdit_6.setText(str(perimetre))
self.lineEdit_6.setToolTip(_translate("MainWindow","Total perimeter of the shape.", None))


ver 1.27 2023/06/30 optimize the styleSheet, correct the left/right position and restore view after edition sketcher
self.tableWidget = QtGui.QTableWidget(self.scrollAreaWidgetContents_2)
{{Code|code=
self.tableWidget.setGeometry(QtCore.QRect(10, 250, 320, 70))
self.PB_00_Decrement.setStyleSheet("background-color: white; border:2px solid rgb(215, 10, 22);") # bord white and red
self.tableWidget.setIconSize(QtCore.QSize(15, 15))
}}
self.tableWidget.setRowCount(RowCount)
replaced by
self.tableWidget.setColumnCount(8) # number of columns
{{Code|code=
self.tableWidget.setObjectName(_fromUtf8("tableWidget"))
self.PB_00_Decrement.setStyleSheet("QPushButton {background-color: white; border:2px solid rgb(215, 10, 22)};") # bord white and red
self.tableWidget.horizontalHeader().setVisible(False)
}}
self.tableWidget.horizontalHeader().setDefaultSectionSize(100)
self.tableWidget.horizontalHeader().setMinimumSectionSize(15)
self.tableWidget.verticalHeader().setVisible(True)
self.tableWidget.verticalHeader().setCascadingSectionResizes(False) #
self.tableWidget.verticalHeader().setDefaultSectionSize(20)
self.tableWidget.verticalHeader().setMinimumSectionSize(20)
self.tableWidget.setToolTip(_translate("MainWindow","Details of the form. \nScoreboard only the first 200 details of the form are displayed. \nAll the elements will be visible in the file after saving it.", None))


<div class="mw-translate-fuzzy">
self.pushButton_Ra = QtGui.QPushButton(self.scrollAreaWidgetContents_2)
*ver 1.22 , 12/11/2020 : now the macro is totally uninstalled i use :
self.pushButton_Ra.setGeometry(QtCore.QRect(35, 338, 91, 20))
</div>
self.pushButton_Ra.setObjectName(_fromUtf8("pushButton_Ra"))
self.pushButton_Ra.clicked.connect(self.on_pushButton_Ra_clicked) #connection pushButton_Ra "Radian"
self.pushButton_Ra.setToolTip(_translate("MainWindow","Toggles between decimal degrees, degrees minutes secondes\nRadian, Grade.", None))


*ver 1.26b 20/02/2022 upgrade for detect BSpline in SubObject
self.lineEdit_8xy = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_8xy.setGeometry(QtCore.QRect(35, 360, 91, 22))
self.lineEdit_8xy.setObjectName(_fromUtf8("lineEdit_8xy"))
self.lineEdit_8xy.setText(str(Plan_xy)+uniteAs)
self.lineEdit_8xy.setToolTip(_translate("MainWindow","Angle in the XY plane.", None))


*ver 1.26 06/02/2022 add info on Mesh and Points objects, decode colours, duplicate object or subObject, memorize the latest path and other preferences options
self.lineEdit_8xya = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_8xya.setGeometry(QtCore.QRect(130, 360, 201, 22))
self.lineEdit_8xya.setObjectName(_fromUtf8("lineEdit_8xya"))
self.lineEdit_8xya.setText(str(Plan_xy_V))


*ver 1.25e 18/12/2021 add info detailed to BSpline (ToByArcs) and info "sel[0].TypeId"
self.lineEdit_8yz = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
*ver 1.25d 12/12/2021 ---
self.lineEdit_8yz.setGeometry(QtCore.QRect(35, 390, 91, 22))
*ver 1.25c 12/12/2021 correct "strAround((" by "str(Around(" and other little ...
self.lineEdit_8yz.setObjectName(_fromUtf8("lineEdit_8yz"))
*ver 1.25b 11/12/2021 correction error in change/modify new material and reorganization
self.lineEdit_8yz.setText(str(Plan_yz)+uniteAs)
*ver 1.25 10/12/2021 PySide2 and add comboBox materials
self.lineEdit_8yz.setToolTip(_translate("MainWindow","Angle in the YZ plane.", None))
*ver 1.24 02/12/2021 add [https://forum.freecadweb.org/viewtopic.php?f=22&t=59852 adjustedGlobalPlacement] modified by edwilliams16 for placement with Body, boundbox tracing
*ver 1.23cb 25/11/2021 delete '''"import Sketcher * "''' create conflict with "'''open(OpenName, "r")'''" ??
Adding
{{Code|code=
FreeCAD.ActiveDocument.openTransaction(u"FCInfo") # memorise les actions (avec annuler restore)
FreeCAD.ActiveDocument.commitTransaction() # restore les actions (avec annuler restore)
#FreeCAD.ActiveDocument.abortTransaction() # abandonne les actions(avec annuler restore)
}}
*ver 1.25d, 13/12/2021 little correction material field uncomment the "'try...Except" !!!
*ver 1.25c, 12/12/2021 little correction new material
*ver 1.23b, 20/11/2021 little correction, add text info in beginning run macro, and ordinal the text code
*ver 1.23 , 19/11/2021 include icon in macro, number decimal displayed, text height, configure options in the Preference FC, correct info for elements of sketch in edit mode.
*ver 1.22 , 12/11/2020 : now the macro is totally uninstalled i use :
{{Code|code=
try:
self.window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True) # destroy
self.window.deleteLater() # destroy
self.window.destroy() # destroy
except Exception:
None
}}


[https://forum.freecadweb.org/viewtopic.php?f=22&t=48013#p411508 How do i exit from FreeCAD instead of Python?]
self.lineEdit_8yza = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_8yza.setGeometry(QtCore.QRect(130, 390, 201, 22))
self.lineEdit_8yza.setObjectName(_fromUtf8("lineEdit_8yza"))
self.lineEdit_8yza.setText(str(Plan_yz_V))

self.lineEdit_8zx = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_8zx.setGeometry(QtCore.QRect(35, 420, 91, 22))
self.lineEdit_8zx.setObjectName(_fromUtf8("lineEdit_8zx"))
self.lineEdit_8zx.setText(str(Plan_zx)+uniteAs)
self.lineEdit_8zx.setToolTip(_translate("MainWindow","Angle in the ZX plane.", None))

self.lineEdit_8zxa = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_8zxa.setGeometry(QtCore.QRect(130, 420, 201, 22))
self.lineEdit_8zxa.setObjectName(_fromUtf8("lineEdit_8zxa"))
self.lineEdit_8zxa.setText(str(Plan_zx_V))

self.lineEdit_9a = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_9a.setGeometry(QtCore.QRect(130, 450, 201, 22))
self.lineEdit_9a.setObjectName(_fromUtf8("lineEdit_9a"))
self.lineEdit_9a.setText(str(surface))
self.lineEdit_9a.setToolTip(_translate("MainWindow","Total area of the form.", None))

self.lineEdit_10a = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_10a.setGeometry(QtCore.QRect(130, 480, 201, 22))
self.lineEdit_10a.setObjectName(_fromUtf8("lineEdit_10a"))
self.lineEdit_10a.setText(str(surfaceFace))
self.lineEdit_10a.setToolTip(_translate("MainWindow","Surface of the face.", None))

self.lineEdit_11a = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_11a.setGeometry(QtCore.QRect(130, 510, 201, 22))
self.lineEdit_11a.setObjectName(_fromUtf8("lineEdit_11a"))
self.lineEdit_11a.setText(str(volume_))
self.lineEdit_11a.setToolTip(_translate("MainWindow","Total volume of the form.", None))

self.lineEdit_12a = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_12a.setGeometry(QtCore.QRect(130, 540, 131, 22))
self.lineEdit_12a.setObjectName(_fromUtf8("lineEdit_12a"))
self.lineEdit_12a.setText(str(poids)+" "+unitePs)
self.lineEdit_12a.setToolTip(_translate("MainWindow","Weight of the form in the selected unit.", None))

self.lineEdit_13x = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_13x.setGeometry(QtCore.QRect(10, 610, 101, 22))
self.lineEdit_13x.setObjectName(_fromUtf8("lineEdit_13x"))
self.lineEdit_13x.setText(str(boundBoxCenterX))
self.lineEdit_13x.setToolTip(_translate("MainWindow","X coordinate of the center of the shape.", None))

self.lineEdit_13y = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_13y.setGeometry(QtCore.QRect(120, 610, 101, 22))
self.lineEdit_13y.setObjectName(_fromUtf8("lineEdit_13y"))
self.lineEdit_13y.setText(str(boundBoxCenterY))
self.lineEdit_13y.setToolTip(_translate("MainWindow","Y coordinate of the center of the shape.", None))

self.lineEdit_13z = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_13z.setGeometry(QtCore.QRect(230, 610, 101, 22))
self.lineEdit_13z.setObjectName(_fromUtf8("lineEdit_13z"))
self.lineEdit_13z.setText(str(boundBoxCenterZ))
self.lineEdit_13z.setToolTip(_translate("MainWindow","Z coordinate of the center of the shape.", None))

self.lineEdit_14x = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_14x.setGeometry(QtCore.QRect(10, 680, 101, 22))
self.lineEdit_14x.setObjectName(_fromUtf8("lineEdit_14x"))
self.lineEdit_14x.setText(str(CenterOfMassX))
self.lineEdit_14x.setToolTip(_translate("MainWindow","X coordinate of the center of mass", None))

self.lineEdit_14y = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_14y.setGeometry(QtCore.QRect(120, 680, 101, 22))
self.lineEdit_14y.setObjectName(_fromUtf8("lineEdit_14y"))
self.lineEdit_14y.setText(str(CenterOfMassY))
self.lineEdit_14y.setToolTip(_translate("MainWindow","Y coordinate of the center of mass", None))

self.lineEdit_14z = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_14z.setGeometry(QtCore.QRect(230, 680, 101, 22))
self.lineEdit_14z.setObjectName(_fromUtf8("lineEdit_14z"))
self.lineEdit_14z.setText(str(CenterOfMassZ))
self.lineEdit_14z.setToolTip(_translate("MainWindow","Z coordinate of the center of mass", None))

self.lineEdit_15 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_15.setGeometry(QtCore.QRect(120, 710, 211, 22))
self.lineEdit_15.setObjectName(_fromUtf8("lineEdit_15"))
self.lineEdit_15.setText(boundBox_S)
self.lineEdit_15.setToolTip(_translate("MainWindow","Dimensions of the form.", None))

self.lineEdit_16_1x = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_1x.setGeometry(QtCore.QRect(10, 780, 86, 22))
self.lineEdit_16_1x.setObjectName(_fromUtf8("lineEdit_16_1x"))
self.lineEdit_16_1x.setText(str(MatrixX1))

self.lineEdit_16_1y = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_1y.setGeometry(QtCore.QRect(105, 780, 86, 22))
self.lineEdit_16_1y.setObjectName(_fromUtf8("lineEdit_16_1y"))
self.lineEdit_16_1y.setText(str(MatrixY1))

self.lineEdit_16_1z = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_1z.setGeometry(QtCore.QRect(200, 780, 86, 22))
self.lineEdit_16_1z.setObjectName(_fromUtf8("lineEdit_16_1z"))
self.lineEdit_16_1z.setText(str(MatrixZ1))

self.lineEdit_16_01 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_01.setGeometry(QtCore.QRect(295, 780, 36, 22))
self.lineEdit_16_01.setObjectName(_fromUtf8("lineEdit_16_01"))
self.lineEdit_16_01.setText(str(Matrix_1))

self.lineEdit_16_2x = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_2x.setGeometry(QtCore.QRect(10, 810, 86, 22))
self.lineEdit_16_2x.setObjectName(_fromUtf8("lineEdit_16_2x"))
self.lineEdit_16_2x.setText(str(MatrixX2))

self.lineEdit_16_2y = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_2y.setGeometry(QtCore.QRect(105, 810, 86, 22))
self.lineEdit_16_2y.setObjectName(_fromUtf8("lineEdit_16_2y"))
self.lineEdit_16_2y.setText(str(MatrixY2))

self.lineEdit_16_2z = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_2z.setGeometry(QtCore.QRect(200, 810, 86, 22))
self.lineEdit_16_2z.setObjectName(_fromUtf8("lineEdit_16_2z"))
self.lineEdit_16_2z.setText(str(MatrixZ2))

self.lineEdit_16_02 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_02.setGeometry(QtCore.QRect(295, 810, 36, 22))
self.lineEdit_16_02.setObjectName(_fromUtf8("lineEdit_16_02"))
self.lineEdit_16_02.setText(str(Matrix_2))

self.lineEdit_16_3x = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_3x.setGeometry(QtCore.QRect(10, 840, 86, 22))
self.lineEdit_16_3x.setObjectName(_fromUtf8("lineEdit_16_3x"))
self.lineEdit_16_3x.setText(str(MatrixX3))

self.lineEdit_16_3y = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_3y.setGeometry(QtCore.QRect(105, 840, 86, 22))
self.lineEdit_16_3y.setObjectName(_fromUtf8("lineEdit_16_3y"))
self.lineEdit_16_3y.setText(str(MatrixY3))

self.lineEdit_16_3z = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_3z.setGeometry(QtCore.QRect(200, 840, 86, 22))
self.lineEdit_16_3z.setObjectName(_fromUtf8("lineEdit_16_3z"))
self.lineEdit_16_3z.setText(str(MatrixZ3))

self.lineEdit_16_03 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_03.setGeometry(QtCore.QRect(295, 840, 36, 22))
self.lineEdit_16_03.setObjectName(_fromUtf8("lineEdit_16_03"))
self.lineEdit_16_03.setText(str(Matrix_3))

self.lineEdit_16_4x = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_4x.setGeometry(QtCore.QRect(10, 870, 86, 22))
self.lineEdit_16_4x.setObjectName(_fromUtf8("lineEdit_16_4x"))
self.lineEdit_16_4x.setText(str(Matrix12))

self.lineEdit_16_4y = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_4y.setGeometry(QtCore.QRect(105, 870, 86, 22))
self.lineEdit_16_4y.setObjectName(_fromUtf8("lineEdit_16_4y"))
self.lineEdit_16_4y.setText(str(Matrix13))

self.lineEdit_16_4z = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_4z.setGeometry(QtCore.QRect(200, 870, 86, 22))
self.lineEdit_16_4z.setObjectName(_fromUtf8("lineEdit_16_4z"))
self.lineEdit_16_4z.setText(str(Matrix14))

self.lineEdit_16_04 = QtGui.QLineEdit(self.scrollAreaWidgetContents_2)
self.lineEdit_16_04.setGeometry(QtCore.QRect(295, 870, 36, 22))
self.lineEdit_16_04.setObjectName(_fromUtf8("lineEdit_16_04"))
self.lineEdit_16_04.setText(str(Matrix15))

self.pushButton_Raf = QtGui.QPushButton(self.window)
self.pushButton_Raf.setGeometry(QtCore.QRect(300, 655, 36, 28))
self.pushButton_Raf.setObjectName(_fromUtf8("pushButton_Raf"))
self.pushButton_Raf.clicked.connect(self.on_pushButton_Raf_clicked) #connection pushButton_Raf "Refresh"

self.pushButton_Lec = QtGui.QPushButton(self.window)
self.pushButton_Lec.setGeometry(QtCore.QRect(15, 655, 86, 28))
self.pushButton_Lec.setObjectName(_fromUtf8("pushButton_Lec"))
self.pushButton_Lec.clicked.connect(self.on_pushButton_Lec_clicked) #connection pushButton_Lec "Read"

self.pushButton_En = QtGui.QPushButton(self.window)
self.pushButton_En.setGeometry(QtCore.QRect(110, 655, 86, 28))
self.pushButton_En.setObjectName(_fromUtf8("pushButton_En"))
self.pushButton_En.clicked.connect(self.on_pushButton_En_clicked) #connection pushButton_En "Save"

self.pushButton_Q = QtGui.QPushButton(self.window)
self.pushButton_Q.setGeometry(QtCore.QRect(205, 655, 86, 28))
self.pushButton_Q.setObjectName(_fromUtf8("pushButton_Q"))
self.pushButton_Q.clicked.connect(self.on_pushButton02_clicked) #connection pushButton02 "Exit"

self.label_1 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_1.setGeometry(QtCore.QRect(10, 10, 111, 16))
self.label_1.setObjectName(_fromUtf8("label_1"))
self.label_2 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_2.setGeometry(QtCore.QRect(10, 40, 101, 16))
self.label_2.setObjectName(_fromUtf8("label_2"))
self.label_3 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_3.setGeometry(QtCore.QRect(10, 70, 111, 16))
self.label_3.setObjectName(_fromUtf8("label_3"))
self.label_4 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_4.setGeometry(QtCore.QRect(10, 100, 171, 16))
self.label_4.setObjectName(_fromUtf8("label_4"))
self.label_4x = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_4x.setGeometry(QtCore.QRect(20, 120, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_4x.setFont(font)
self.label_4x.setObjectName(_fromUtf8("label_4x"))
self.label_4y = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_4y.setGeometry(QtCore.QRect(130, 120, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_4y.setFont(font)
self.label_4y.setObjectName(_fromUtf8("label_4y"))
self.label_4z = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_4z.setGeometry(QtCore.QRect(240, 120, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_4z.setFont(font)
self.label_4z.setObjectName(_fromUtf8("label_4z"))
self.label_5 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_5.setGeometry(QtCore.QRect(10, 172, 121, 16))
self.label_5.setObjectName(_fromUtf8("label_5"))

self.comboBox = QtGui.QComboBox(self.scrollAreaWidgetContents_2)
self.comboBox.setGeometry(QtCore.QRect(30, 170, 81, 22))
self.comboBox.setObjectName(_fromUtf8("comboBox"))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.setToolTip(_translate("MainWindow","Selects a unit of length.", None))
QtCore.QObject.connect(self.comboBox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.SIGNAL_comboBox_Changed)

self.label_6 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_6.setGeometry(QtCore.QRect(10, 200, 131, 16))
self.label_6.setObjectName(_fromUtf8("label_6"))
self.label_7 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_7.setGeometry(QtCore.QRect(10, 230, 320, 16))
self.label_7.setObjectName(_fromUtf8("label_7"))
self.label_8 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_8.setGeometry(QtCore.QRect(10, 320, 71, 16))
self.label_8.setObjectName(_fromUtf8("label_8"))
self.label_8a = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_8a.setGeometry(QtCore.QRect(10, 340, 31, 16))
self.label_8a.setObjectName(_fromUtf8("label_8a"))
self.label_8a_2 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_8a_2.setGeometry(QtCore.QRect(135, 340, 91, 16))
self.label_8a_2.setObjectName(_fromUtf8("label_8a"))
self.label_8xy = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_8xy.setGeometry(QtCore.QRect(13, 360, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_8xy.setFont(font)
self.label_8xy.setObjectName(_fromUtf8("label_8xy"))
self.label_8yz = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_8yz.setGeometry(QtCore.QRect(13, 390, 16, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_8yz.setFont(font)
self.label_8yz.setObjectName(_fromUtf8("label_8yz"))
self.label_8zx = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_8zx.setGeometry(QtCore.QRect(13, 420, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_8zx.setFont(font)
self.label_8zx.setObjectName(_fromUtf8("label_8zx"))
self.label_9 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_9.setGeometry(QtCore.QRect(10, 450, 121, 16))
self.label_9.setObjectName(_fromUtf8("label_9"))
self.label_10 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_10.setGeometry(QtCore.QRect(10, 480, 121, 16))
self.label_10.setObjectName(_fromUtf8("label_10"))
self.label_11 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_11.setGeometry(QtCore.QRect(10, 510, 121, 16))
self.label_11.setObjectName(_fromUtf8("label_11"))
self.label_12 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_12.setGeometry(QtCore.QRect(10, 542, 81, 16))
self.label_12.setObjectName(_fromUtf8("label_12"))

self.comboBox2 = QtGui.QComboBox(self.scrollAreaWidgetContents_2)
self.comboBox2.setGeometry(QtCore.QRect(10, 540, 115, 22))
self.comboBox2.setObjectName(_fromUtf8("comboPoids"))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.addItem(_fromUtf8(""))
self.comboBox2.setToolTip(_translate("MainWindow","Select a unit of mass.", None))
QtCore.QObject.connect(self.comboBox2, QtCore.SIGNAL("currentIndexChanged(QString)"), self.SIGNAL_comboPoids_Changed)

self.doubleSpinBox = QtGui.QDoubleSpinBox(self.scrollAreaWidgetContents_2)
self.doubleSpinBox.setGeometry(QtCore.QRect(270, 540, 61, 22))
self.doubleSpinBox.setSingleStep(0.01)
self.doubleSpinBox.setProperty("value", densite)
self.doubleSpinBox.setObjectName(_fromUtf8("doubleSpinBox"))
self.doubleSpinBox.setToolTip(_translate("MainWindow","Select the volume density in Kg by dm3.", None))
self.doubleSpinBox.valueChanged.connect(self.on_doubleSpinBox_valueChanged) #connection doubleSpinBox

self.label_13 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_13.setGeometry(QtCore.QRect(10, 570, 141, 16))
self.label_13.setObjectName(_fromUtf8("label_13"))
self.label_13x = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_13x.setGeometry(QtCore.QRect(20, 590, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_13x.setFont(font)
self.label_13x.setObjectName(_fromUtf8("label_13x"))
self.label_13y = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_13y.setGeometry(QtCore.QRect(130, 590, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_13y.setFont(font)
self.label_13y.setObjectName(_fromUtf8("label_13y"))
self.label_13z = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_13z.setGeometry(QtCore.QRect(240, 590, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_13z.setFont(font)
self.label_13z.setObjectName(_fromUtf8("label_13z"))
self.label_14 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_14.setGeometry(QtCore.QRect(10, 640, 141, 16))
self.label_14.setObjectName(_fromUtf8("label_14"))
self.label_14x = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_14x.setGeometry(QtCore.QRect(20, 660, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_14x.setFont(font)
self.label_14x.setObjectName(_fromUtf8("label_14x"))
self.label_14y = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_14y.setGeometry(QtCore.QRect(130, 660, 16, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_14y.setFont(font)
self.label_14y.setObjectName(_fromUtf8("label_14y"))
self.label_14z = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_14z.setGeometry(QtCore.QRect(240, 660, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_14z.setFont(font)
self.label_14z.setObjectName(_fromUtf8("label_14z"))

self.label_15 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_15.setGeometry(QtCore.QRect(10, 710, 131, 16))
self.label_15.setObjectName(_fromUtf8("label_15"))

self.label_16 = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_16.setGeometry(QtCore.QRect(10, 740, 101, 16))
self.label_16.setObjectName(_fromUtf8("label_16"))

self.label_16x = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_16x.setGeometry(QtCore.QRect(20, 760, 31, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_16x.setFont(font)
self.label_16x.setObjectName(_fromUtf8("label_16x"))

self.label_16y = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_16y.setGeometry(QtCore.QRect(110, 760, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_16y.setFont(font)
self.label_16y.setObjectName(_fromUtf8("label_16y"))

self.label_16z = QtGui.QLabel(self.scrollAreaWidgetContents_2)
self.label_16z.setGeometry(QtCore.QRect(210, 760, 21, 16))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label_16z.setFont(font)
self.label_16z.setObjectName(_fromUtf8("label_16z"))

###########################################################scrollArea
self.scrollArea.setWidget(self.scrollAreaWidgetContents_2)
MainWindow.setCentralWidget(self.centralWidget)
###########################################################scrollArea
self.retranslateUi(MainWindow)
self.comboBox.setCurrentIndex(6)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "FCInfo", None))
MainWindow.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) #
MainWindow.setWindowIcon(QtGui.QIcon(path+'FCInfo.png')) #
# MainWindow.setWindowFlags(PyQt4.QtCore.Qt.FramelessWindowHint) # This function removes the frame and the window button
self.label_1.setText(_translate("MainWindow", "Document name", None))
self.label_2.setText(_translate("MainWindow", "Name / Type", None))
# self.label_2a.setText(_translate("MainWindow", "Object name", None))
self.label_3.setText(_translate("MainWindow", "Sub. objet name", None))
self.label_4.setText(_translate("MainWindow", "Coordinates mouse click", None))
self.label_4x.setText(_translate("MainWindow", "X", None))
self.label_4y.setText(_translate("MainWindow", "Y", None))
self.label_4z.setText(_translate("MainWindow", "Z", None))
self.label_5.setText(_translate("MainWindow", "Lg.", None))
#http://fr.wikipedia.org/wiki/Unit%C3%A9s_de_mesure_anglo-saxonnes
self.comboBox.setItemText(0, _translate("MainWindow", "km", None)) #km # = 1000000
self.comboBox.setItemText(1, _translate("MainWindow", "hm", None)) #hm # = 100000
self.comboBox.setItemText(2, _translate("MainWindow", "dam", None)) #dam# = 10000
self.comboBox.setItemText(3, _translate("MainWindow", "m", None)) #m # = 1000
self.comboBox.setItemText(4, _translate("MainWindow", "dm", None)) #dm # = 100
self.comboBox.setItemText(5, _translate("MainWindow", "cm", None)) #cm # = 10
self.comboBox.setItemText(6, _translate("MainWindow", "mm", None)) #mm # = 1
self.comboBox.setItemText(7, _translate("MainWindow", "inch", None)) #in # inch pouce = 25.400
self.comboBox.setItemText(8, _translate("MainWindow", "link", None)) #lk # link chaînon = 201.168
self.comboBox.setItemText(9, _translate("MainWindow", "foot", None)) #ft # foot pied = 304.800
self.comboBox.setItemText(10, _translate("MainWindow", "yard", None)) #yd # yard verge = 914.400
self.comboBox.setItemText(11, _translate("MainWindow", "perch", None)) #rd # rod ou perch perche = 5029.200
self.comboBox.setItemText(12, _translate("MainWindow", "chain", None)) #ch # chain chaîne = 20116.800
self.comboBox.setItemText(13, _translate("MainWindow", "furlong", None)) #fur# furlong = 201168
self.comboBox.setItemText(14, _translate("MainWindow", "mile", None)) #mi # mile = 1609344
self.comboBox.setItemText(15, _translate("MainWindow", "league", None)) #lea# league lieue = 4828032
self.comboBox.setItemText(16, _translate("MainWindow", "nautique", None)) #nmi# mile nautique = 1852000
self.label_6.setText(_translate("MainWindow", "Perim. the shape", None))
if RowCountTest > RowCount:
self.label_7.setText(_translate("MainWindow", "Details ("+ str(compt_E) +") ("+ str(compt_F)+") ("+ str(compt_VF)+") (!+ "+str(RowCount)+") "+str(RowCountTest), None))
else:
self.label_7.setText(_translate("MainWindow", "Vertexes and détails ("+ str(compt_E) +") ("+ str(compt_F)+") ("+ str(compt_VF)+")", None))#str(RowCount)
self.label_8.setText(_translate("MainWindow", "Inclinations", None))
self.pushButton_Ra.setText(_translate("MainWindow", "Degree", None))
self.label_8a.setText(_translate("MainWindow", "Plan", None))
self.label_8a_2.setText(_translate("MainWindow", "Coordinates", None))
self.label_8xy.setText(_translate("MainWindow", "XY", None))
self.label_8yz.setText(_translate("MainWindow", "YZ", None))
self.label_8zx.setText(_translate("MainWindow", "ZX", None))
self.label_9.setText(_translate("MainWindow", "The form surface", None))
self.label_10.setText(_translate("MainWindow", "Surface of the face", None))
self.label_11.setText(_translate("MainWindow", "Volume of the form", None))
self.label_12.setText(_translate("MainWindow", "Po.", None))

self.comboBox2.setCurrentIndex(5)
self.comboBox2.setItemText(0, _translate("MainWindow", "tonne", None)) #t # = 1000000
self.comboBox2.setItemText(1, _translate("MainWindow", "quintal", None)) #q # = 100000
self.comboBox2.setItemText(2, _translate("MainWindow", "kilo gram", None)) #kg # = 1000
self.comboBox2.setItemText(3, _translate("MainWindow", "hecto gram", None)) #hg # = 100
self.comboBox2.setItemText(4, _translate("MainWindow", "decagram", None)) #dag # = 10
self.comboBox2.setItemText(5, _translate("MainWindow", "gram", None)) #g # = 1
self.comboBox2.setItemText(6, _translate("MainWindow", "decigram", None)) #dg # = 0.1
self.comboBox2.setItemText(7, _translate("MainWindow", "centigram", None)) #cg # = 0.01
self.comboBox2.setItemText(8, _translate("MainWindow", "milligram", None)) #mg # = 0.001
self.comboBox2.setItemText(9, _translate("MainWindow", "grain", None)) #gr # = 0.06479891 g
self.comboBox2.setItemText(10, _translate("MainWindow", "drachm", None)) #dr # = 1.7718451953125 g
self.comboBox2.setItemText(11, _translate("MainWindow", "once", None)) #oz # = 28.3495231250 g
self.comboBox2.setItemText(12, _translate("MainWindow", "once troy", None)) #oz t # = 31.1034768 g once troy
self.comboBox2.setItemText(13, _translate("MainWindow", "livre troy", None)) #lb t # = 373.2417216 g livre de troy
self.comboBox2.setItemText(14, _translate("MainWindow", "livre av", None)) #lb # = 453.59237 g livre avoirdupois pound
self.comboBox2.setItemText(15, _translate("MainWindow", "stone", None)) #st # = 6350.29318 g
self.comboBox2.setItemText(16, _translate("MainWindow", "quarter", None)) #qtr # = 12700.58636 g
self.comboBox2.setItemText(17, _translate("MainWindow", "hundredweight", None)) #cwt # = 50802.34544 g
self.comboBox2.setItemText(18, _translate("MainWindow", "tonneau fr", None)) # # = 0.00000102145045965 g
self.comboBox2.setItemText(19, _translate("MainWindow", "carat", None)) #cd # = 0.2 g

self.label_13.setText(_translate("MainWindow", "Center of the shape", None))
self.label_13x.setText(_translate("MainWindow", "X", None))
self.label_13y.setText(_translate("MainWindow", "Y", None))
self.label_13z.setText(_translate("MainWindow", "Z", None))
self.label_14.setText(_translate("MainWindow", "Center of mass", None))
self.label_14x.setText(_translate("MainWindow", "X", None))
self.label_14y.setText(_translate("MainWindow", "Y", None))
self.label_14z.setText(_translate("MainWindow", "Z", None))
self.label_15.setText(_translate("MainWindow", "BoundBox", None))
self.label_16.setText(_translate("MainWindow", "Moment of inertia", None))
self.label_16x.setText(_translate("MainWindow", "X", None))
self.label_16y.setText(_translate("MainWindow", "Y", None))
self.label_16z.setText(_translate("MainWindow", "Z", None))
self.pushButton_Raf.setText(_translate("MainWindow", "Ref", None))
self.pushButton_Lec.setText(_translate("MainWindow", "Read", None))
self.pushButton_En.setText(_translate("MainWindow", "Save", None))
self.pushButton_Q.setText(_translate("MainWindow", "Exit", None))
def SIGNAL_comboPoids_Changed(self,text):
global sel
global document_
global object_
global typeObject
global element_
global position0
global position1
global position2
global longueurObjet
global perimetre

global Plan_xy
global Plan_xy_V
global Plan_yz
global Plan_yz_V
global Plan_zx
global Plan_zx_V

global surface
global surfaceFace
global volume_
global densite
global poids
global uniteM
global uniteMs
global uniteS
global uniteSs
global uniteV
global uniteVs
global uniteP
global unitePs
global uniteAs

global Vertx
global Edges
global EdgesLong
global Faces
global FacesSurf
global compt_E
global compt_F
global compt_VF
global placement_
global RowCount
global RowCountTest
global pas
text = unicode(text, 'ISO-8859-1').encode('UTF-8')
if text == "tonne": #t #0.00001 = 1000000
uniteP = 0.000001
unitePs= "t"
elif text == "quintal": #q #0.00001 = 100000
uniteP = 0.00001
unitePs= "q"
elif text == "kilo gram": #kg # 0.001 = 1000
uniteP = 0.001
unitePs= "kg"
elif text == "hecto gram": #hg # 0.01 = 100
uniteP = 0.01
unitePs= "hg"
elif text == "decagram": #dag# 0.1 = 10
uniteP = 0.1
unitePs= "dag"
elif text == "gram": #g # 1 = 1
uniteP = 1.00
unitePs= "g"
elif text == "decigram": #dg # = 0.1
uniteP = 10
unitePs= "dg"
elif text == "centigram": #cg # = 0.01
uniteP = 100
unitePs= "cg"
elif text == "milligram": #mg # = 0.001
uniteP = 1000
unitePs= "mg"
elif text == "grain": #gr # = 0.06479891
uniteP = 0.06479891
unitePs= "gr"
elif text == "drachm": #dr # = 1.7718451953125
uniteP = 0.56438339189006794681850148894339
unitePs= "dr"
elif text == "once": #oz # = 28.3495231250
uniteP = 0.035273961949580412915675808215204
unitePs= "oz"
elif text == "once troy": #oz t # = once troy = 31.1034768
uniteP = 0.032150746568627980522100346029483
unitePs= "oz t"
elif text == "livre troy": #lb t # = 373.2417216 livre de troy (pound)
uniteP = 0.0026792288807189983768416955024569
unitePs= "lb t"
elif text == "livre av": #lb # = 453.59237 livre avoirdupois (pound)
uniteP = 0.0022046226218487758072297380134503
unitePs= "lb"
elif text == "stone": #st # = 6350.29318 1 stone = 14 livres
uniteP = 0.00015747304441776970051640985810359
unitePs= "st"
elif text == "quarter": #qtr # = 12700.58636
uniteP = 0.000078736522208884850258204929051795
unitePs= "qtr"
elif text == "hundredweight":#cwt # = 50802.34544
uniteP = 0.000019684130552221212564551232262949
unitePs= "cwt"
elif text == "tonneau fr": # # tonneau fr = 0.00000102145045965
uniteP = 0.00000102145045965
unitePs= "tonneau fr"
elif text == "carat": #cd # = 0.2
uniteP = 5
unitePs= "cd"
try:
poids = ((volume_ * densite) * uniteP) / 1000
self.lineEdit_12a.setText(str(poids)+" "+unitePs)
except:
self.lineEdit_12a.setText("")

def SIGNAL_comboBox_Changed(self,text):
global ui
global sel
global document_
global object_
global typeObject
global element_
global position0
global position1
global position2
global longueurObjet
global perimetre

global Plan_xy
global Plan_xy_V
global Plan_yz
global Plan_yz_V
global Plan_zx
global Plan_zx_V

global surface
global surfaceFace
global volume_
global densite
global poids
global uniteM
global uniteMs
global uniteS
global uniteSs
global uniteV
global uniteVs
global uniteP
global unitePs
global uniteAs

global boundBoxCenterX
global boundBoxCenterY
global boundBoxCenterZ

global boundBoxCenter

global CenterOfMassX
global CenterOfMassY
global CenterOfMassZ

global boundBox_
global boundBoxLX
global boundBoxLY
global boundBoxLZ
global boundBox_S
global MatrixX1
global MatrixY1
global MatrixZ1
global Matrix_1
global MatrixX2
global MatrixY2
global MatrixZ2
global Matrix_2
global MatrixX3
global MatrixY3
global MatrixZ3
global Matrix_3
global Matrix12
global Matrix13
global Matrix14
global Matrix15

global Vertx
global Edges
global EdgesLong
global Faces
global FacesSurf
global FacesCoor
global compt_E
global compt_F
global compt_VF
global placement_
global RowCount
global RowCountTest
global pas
text = unicode(text, 'ISO-8859-1').encode('UTF-8')
if text == "km": # = 1000000
uniteM = 0.000001
uniteMs= "km"
uniteS = 0.000000000001
uniteSs= u"km²"
uniteV = 0.000000000000000001
uniteVs= u"km³"
elif text == "hm": # = 100000
uniteM = 0.00001
uniteMs= "hm"
uniteS = 0.0000000001
uniteSs= u"hm²"
uniteV = 0.000000000000001
uniteVs= u"hm³"
elif text == "dam": # = 10000
uniteM = 0.0001
uniteMs= "dam"
uniteS = 0.00000001
uniteSs= u"dam²"
uniteV = 0.000000000001
uniteVs= u"dam³"
elif text == "m": # = 1000
uniteM = 0.001
uniteMs= "m"
uniteS = 0.000001
uniteSs= u"m²"
uniteV = 0.000000001
uniteVs= u"m³"
elif text == "dm": # = 100
uniteM = 0.01
uniteMs= "dm"
uniteS = 0.0001
uniteSs= u"dm²"
uniteV = 0.000001
uniteVs= u"dm³"
elif text == "cm": # = 10
uniteM = 0.1
uniteMs= "cm"
uniteS = 0.01
uniteSs= u"cm²"
uniteV = 0.001
uniteVs= u"cm³"
elif text == "mm": # = 1 ###############################
uniteM = 1.0
uniteMs= "mm"
uniteS = 1.0
uniteSs= u"mm²"
uniteV = 1.0
uniteVs= u"mm³"
elif text == "inch": # inch = 25.400
uniteM = 1.0/25.400
uniteMs= "in"
uniteS = uniteM**2
uniteSs= "sq in"
uniteV = uniteM**3
uniteVs= u"in³"
elif text == "link": # link = 201.168
uniteM = 1.0/201.168
uniteMs= "lk"
uniteS = uniteM**2
uniteSs= "sq lk"
uniteV = uniteM**3
uniteVs= u"lk³"
elif text == "foot": # foot = 304.800
uniteM = 1.0/304.800
uniteMs= "ft"
uniteS = uniteM**2
uniteSs= "sq ft"
uniteV = uniteM**3
uniteVs= u"ft³"
elif text == "yard": # yard = 914.400
uniteM = 1.0/914.400
uniteMs= "yd"
uniteS = uniteM**2
uniteSs= "sq yd"
uniteV = uniteM**3
uniteVs= u"yd³"
elif text == "perch": #rd # rod perche = 5029.200
uniteM = 1.0/5029.200
uniteMs= "rd"
uniteS = uniteM**2
uniteSs= "sq rd"
uniteV = uniteM**3
uniteVs= u"rd³"
elif text == "chain": # chain = 20116.800
uniteM = 1.0/20116.800
uniteMs= "ch"
uniteS = uniteM**2
uniteSs= "sq ch"
uniteV = uniteM**3
uniteVs= u"ch³"
elif text == "furlong": # furlong= 201168
uniteM = 1.0/201168
uniteMs= "fur"
uniteS = uniteM**2
uniteSs= "sq fur"
uniteV = uniteM**3
uniteVs= u"fur³"
elif text == "mile": # mile = 1609344
uniteM = 1.0/1609344
uniteMs= "mi"
uniteS = uniteM**2
uniteSs= "sq mi"
uniteV = uniteM**3
uniteVs= u"mi³"
elif text == "league": # league = 4828032
uniteM = 1.0/4828032
uniteMs= "lea"
uniteS = uniteM**2
uniteSs= "sq lea"
uniteV = uniteM**3
uniteVs= u"lea³"
elif text == "nautique": # nautique = 1852000
uniteM = 1.0/1852000
uniteMs= "nmi"
uniteS = uniteM**2
uniteSs= "sq nmi"
uniteV = uniteM**3
uniteVs= u"nmi³"

try:
self.lineEdit_5.setText(str(float(longueurObjet) * float(uniteM))+" "+uniteMs)
except:
self.lineEdit_5.setText("")
try:
self.lineEdit_6.setText(str(float(perimetre) * float(uniteM))+" "+uniteMs)
except:
self.lineEdit_6.setText("")
try:
self.lineEdit_9a.setText(str(float(surface) * float(uniteS))+" "+uniteSs)
except:
self.lineEdit_9a.setText("")
try:
self.lineEdit_10a.setText(str(float(surfaceFace) * float(uniteS))+" "+uniteSs)
except:
self.lineEdit_10a.setText("")
try:
self.lineEdit_11a.setText(str(float(volume_) * float(uniteV))+" "+uniteVs)
except:
self.lineEdit_11a.setText("")
try:
boundBox_S = "[X: "+str(boundBoxLX * uniteM)+" "+uniteMs+"] x [Y: "+str(boundBoxLY * uniteM)+" "+uniteMs+"] x [Z: "+str(boundBoxLZ * uniteM)+" "+uniteMs+"]"
self.lineEdit_15.setText(boundBox_S)
except:
self.lineEdit_15.setText("")
co = 0
li = 0
for li in range(RowCount): # Zero
for co in range(8):
newitem = QtGui.QTableWidgetItem("")
self.tableWidget.setItem( li,co, newitem)
co = 0
li = 0
aa = 0
for j in enumerate(Edges): # Edges
newitem = QtGui.QTableWidgetItem(str(j[1]))
self.tableWidget.setItem( li,0, newitem)
newitem = QtGui.QTableWidgetItem(str(float(EdgesLong[li]) * float(uniteM))+" "+uniteMs)
self.tableWidget.setItem( li,1, newitem)
co+=1
try:
for a in range(aa,aa+6): # Vertexes
co += 1
newitem = QtGui.QTableWidgetItem(str(Vertx[a]))
self.tableWidget.setItem( li,co, newitem)
except:
None
aa += 6
co = 0
li+= 1
li += 1
co = 0
cco = 0
co2 = 0
for j in enumerate(Faces):
newitem = QtGui.QTableWidgetItem(str(j[1]))
self.tableWidget.setItem( li,0, newitem)
newitem = QtGui.QTableWidgetItem(str(float(FacesSurf[co]) * float(uniteS))+" "+uniteSs)
self.tableWidget.setItem( li,1, newitem)
li+= 1
for jj in range(cco,len(FacesCoor)):# Faces coordinates
cco+=1
if FacesCoor[jj] == "T":
break
else:
newitem = QtGui.QTableWidgetItem(FacesCoor[jj])
self.tableWidget.setItem( li,co2, newitem)
co2 += 1
if co2 == 3:
li += 1
co2 = 0
co += 1
li += 1

# doubleSpinBox_1 poids
def on_doubleSpinBox_valueChanged(self,densiteSB): # SpinBox
global volume_
global uniteP
global unitePs
global densite
global poids
densite = densiteSB
poids = ((volume_ * densite) * uniteP) / 1000 # base FreeCAD = mm
self.lineEdit_12a.setText(str(poids) +" "+ unitePs)

def on_pushButton_Raf_clicked(self): # refresh
global sel
global document_
global object_
global typeObject
global element_
global position0
global position1
global position2
global longueurObjet
global perimetre

global Plan_xy
global Plan_xy_V
global Plan_yz
global Plan_yz_V
global Plan_zx
global Plan_zx_V

global surface
global surfaceFace
global volume_
global densite
global poids
global uniteM
global uniteMs
global uniteS
global uniteSs
global uniteV
global uniteVs
global uniteP
global unitePs
global uniteAs

global boundBoxCenterX
global boundBoxCenterY
global boundBoxCenterZ

global boundBoxCenter

global CenterOfMassX
global CenterOfMassY
global CenterOfMassZ

global boundBox_
global boundBoxLX
global boundBoxLY
global boundBoxLZ
global boundBox_S
global MatrixX1
global MatrixY1
global MatrixZ1
global Matrix_1
global MatrixX2
global MatrixY2
global MatrixZ2
global Matrix_2
global MatrixX3
global MatrixY3
global MatrixZ3
global Matrix_3
global Matrix12
global Matrix13
global Matrix14
global Matrix15

global Vertx
global Edges
global EdgesLong
global Faces
global FacesSurf
global FacesCoor
global compt_E
global compt_F
global compt_VF
global placement_
global RowCount
global RowCountTest
global path
global SaveName

sel = FreeCADGui.Selection.getSelection()
if len(sel)==0:
App.Console.PrintMessage("Select an object"+"\n")
errorDialog("Select an object")
else:
affect()
self.lineEdit_1.setText(document_)
self.lineEdit_2.setText(object_)
self.lineEdit_2a.setText(typeObject)
self.lineEdit_3.setText(str(element_))
self.lineEdit_4x.setText(str(position0))
self.lineEdit_4y.setText(str(position1))
self.lineEdit_4z.setText(str(position2))
self.lineEdit_5.setText(str(longueurObjet * uniteM)+" "+uniteMs)
self.comboBox.setCurrentIndex(6)
self.lineEdit_6.setText(str(perimetre * uniteM)+" "+uniteMs)
self.pushButton_Ra.setText(_translate("MainWindow", "Degree", None))
if RowCountTest > RowCount:
self.label_7.setText(_translate("MainWindow", "Details ("+ str(compt_E) +") ("+ str(compt_F)+") ("+ str(compt_VF)+") (!+ "+str(RowCount)+") "+str(RowCountTest), None))
else:
self.label_7.setText(_translate("MainWindow", "Vertexes and details ("+ str(compt_E) +") ("+ str(compt_F)+") ("+ str(compt_VF)+")", None))#str(RowCount)
co = 0
li = 0
for li in range(RowCount): # Zero
for co in range(8):
newitem = QtGui.QTableWidgetItem("")
self.tableWidget.setItem( li,co, newitem)

co = 0
li = 0
aa = 0
for j in enumerate(Edges): # Edges
newitem = QtGui.QTableWidgetItem(str(j[1]))
self.tableWidget.setItem( li,0, newitem)
newitem = QtGui.QTableWidgetItem(str(float(EdgesLong[li]) * float(uniteM))+" "+uniteMs)
self.tableWidget.setItem( li,1, newitem)
co+=1
try:
for a in range(aa,aa+6): # Vertexes
co += 1
newitem = QtGui.QTableWidgetItem(str(Vertx[a]))
self.tableWidget.setItem( li,co, newitem)
except:
None
aa += 6
co = 0
li += 1

li += 1
co = 0
cco = 0
co2 = 0
for j in enumerate(Faces): # Faces
newitem = QtGui.QTableWidgetItem(str(j[1]))
self.tableWidget.setItem( li,0, newitem)
newitem = QtGui.QTableWidgetItem(str(float(FacesSurf[co]) * float(uniteS))+" "+uniteSs)
self.tableWidget.setItem( li,1, newitem)
li += 1
for jj in range(cco,len(FacesCoor)):# Faces coordinates
cco+=1
if FacesCoor[jj] == "T":
break
else:
newitem = QtGui.QTableWidgetItem(FacesCoor[jj])
self.tableWidget.setItem( li,co2, newitem)
co2 += 1
if co2 == 3:
li += 1
co2 = 0
co += 1
li += 1

self.lineEdit_8xy.setText(str(Plan_xy)+uniteAs)
self.lineEdit_8xya.setText(str(Plan_xy_V))
self.lineEdit_8yz.setText(str(Plan_yz)+uniteAs)
self.lineEdit_8yza.setText(str(Plan_yz_V))
self.lineEdit_8zx.setText(str(Plan_zx)+uniteAs)
self.lineEdit_8zxa.setText(str(Plan_zx_V))
self.lineEdit_9a.setText(str(surface * uniteS)+" "+uniteSs)
self.lineEdit_10a.setText(str(surfaceFace * uniteS)+" "+uniteSs)
self.lineEdit_11a.setText(str(volume_ * uniteV)+" "+uniteVs)
self.lineEdit_12a.setText(str(poids)+" "+unitePs)
self.lineEdit_13x.setText(str(boundBoxCenterX))
self.lineEdit_13y.setText(str(boundBoxCenterY))
self.lineEdit_13z.setText(str(boundBoxCenterZ))
self.lineEdit_14x.setText(str(CenterOfMassX))
self.lineEdit_14y.setText(str(CenterOfMassY))
self.lineEdit_14z.setText(str(CenterOfMassZ))
self.lineEdit_15.setText(boundBox_S)
self.lineEdit_16_1x.setText(str(MatrixX1))
self.lineEdit_16_1y.setText(str(MatrixY1))
self.lineEdit_16_1z.setText(str(MatrixZ1))
self.lineEdit_16_01.setText(str(Matrix_1))
self.lineEdit_16_2x.setText(str(MatrixX2))
self.lineEdit_16_2y.setText(str(MatrixY2))
self.lineEdit_16_2z.setText(str(MatrixZ2))
self.lineEdit_16_02.setText(str(Matrix_2))
self.lineEdit_16_3x.setText(str(MatrixX3))
self.lineEdit_16_3y.setText(str(MatrixY3))
self.lineEdit_16_3z.setText(str(MatrixZ3))
self.lineEdit_16_03.setText(str(Matrix_3))
self.lineEdit_16_4x.setText(str(Matrix12))
self.lineEdit_16_4y.setText(str(Matrix13))
self.lineEdit_16_4z.setText(str(Matrix14))
self.lineEdit_16_04.setText(str(Matrix15))
##################################################################################################################
def on_pushButton_Lec_clicked(self): # lecture
OpenName = ""
OpenName = QFileDialog.getOpenFileName(None,QString.fromLocal8Bit("Read a txt file"),path,"*.FCInfo *.txt")
try:
if OpenName != "":
App.Console.PrintMessage("Reading the file "+OpenName+"\n")
fileFCInfoW = ""
file = open(OpenName, "rb")
reader = csv.reader(file)
Count0 = 0
ligne = 0
colonne = 0
try: #
for row in reader:
ligne += 1 #
for field in row:
Count0 += 1 #
if Count0 > colonne:
colonne = Count0
Count0 = 0
finally:
file.close()

self.table = QTableWidget( ligne , colonne)
self.table.setWindowTitle(_translate("MainWindow", "FCInfo Patience reading the file", None))
self.table.resize(700, 500)
self.table.setWindowModality(QtCore.Qt.NonModal)
self.table.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) #
self.table.setWindowIcon(QtGui.QIcon(path+'FCInfoSpreadsheet.png'))#
self.table.show()

file = open(OpenName, "rb")
reader = csv.reader(file)
lignes = ligne
colonne = 0
ligne = 0
try:
for row in reader:
for field in row:
newitem = QtGui.QTableWidgetItem(str(field))
self.table.setItem(ligne, colonne, newitem)
colonne += 1
ligne += 1
colonne = 0
self.table.setWindowTitle(_translate("MainWindow", "FCInfo Patience reading the file "+str(ligne)+"/"+str(lignes), None))
finally:
file.close()
self.table.setWindowTitle(_translate("MainWindow", "FCInfo Tableau " + OpenName, None))
except:
App.Console.PrintMessage("Error in reading the file "+OpenName+"\n")
errorDialog(u"Error in reading the file "+OpenName)
##################################################################################################################
def on_pushButton_En_clicked(self,text): # registation
global sel
global document_
global object_
global typeObject
global element_
global position0
global position1
global position2
global longueurObjet
global perimetre

global Plan_xy
global Plan_xy_V
global Plan_yz
global Plan_yz_V
global Plan_zx
global Plan_zx_V

global surface
global surfaceFace
global volume_
global densite
global poids
global uniteM
global uniteMs
global uniteS
global uniteSs
global uniteV
global uniteVs
global uniteP
global unitePs
global uniteAs

global boundBoxCenterX
global boundBoxCenterY
global boundBoxCenterZ

global boundBoxCenter

global CenterOfMassX
global CenterOfMassY
global CenterOfMassZ

global boundBox_
global boundBoxLX
global boundBoxLY
global boundBoxLZ
global boundBox_S
global MatrixX1
global MatrixY1
global MatrixZ1
global Matrix_1
global MatrixX2
global MatrixY2
global MatrixZ2
global Matrix_2
global MatrixX3
global MatrixY3
global MatrixZ3
global Matrix_3
global Matrix12
global Matrix13
global Matrix14
global Matrix15

global Vertx
global Edges
global EdgesLong
global Faces
global FacesSurf
global FacesCoor
global compt_E
global compt_F
global compt_VF
global placement_
global RowCount
global RowCountTest
global path
global SaveName

SaveName = ""
SaveName = QFileDialog.getSaveFileName(None,QString.fromLocal8Bit("Save a file FCInfo"),path,"*.FCInfo")
if SaveName == "":
App.Console.PrintMessage("Process aborted"+"\n")
errorDialog("Process aborted")
else:
App.Console.PrintMessage("Registration of "+SaveName+"\n")
try:
f = open(SaveName, 'w') # write
f.write(iso8859("Info on the element\n"))
f.write(iso8859("___________________\n"))
f.write(iso8859(dateUs()+" "+heure()+"\n\n"))
f.write(iso8859("Name of the document :, "+document_+"\n"))
f.write(iso8859("Name of the object :, "+object_+"\n"))
f.write(iso8859("Object type :, "+typeObject+"\n"))
f.write(iso8859("Name of the element :, "+str(element_)+"\n"))
f.write(iso8859("Mouse coordinates :, X:, "+str(position0)+", Y:, "+str(position1)+", Z:, "+str(position2)+"\n"))
f.write(iso8859("Length of the object :, "+str(longueurObjet * uniteM)+", "+uniteMs+"\n"))
f.write(iso8859("Perimeter of the shape :, "+str(perimetre * uniteM)+", "+uniteMs+"\n\n"))
f.write(iso8859(u"Vertexes and détails :, Edges :,"+ str(compt_E) +", Faces :,"+ str(compt_F)+", Vertexes faces :,"+ str(compt_VF)+", Total :,"+str(RowCountTest)+"\n\n"))
co = 0
aa = 0
for j in enumerate(Edges):
f.write(str(j[1])+" , "+iso8859(str(float(EdgesLong[co]) * float(uniteM))+" , "+uniteMs+","))#"\n"
co+=1
for a in range(aa,aa+6):
try:
# f.write(str(Vertx[a][0:3])+" , "+str(Vertx[a][4:len(Vertx[a])])+" , ")
chaine = str(Vertx[a]).split(":")
f.write(chaine[0]+" , "+chaine[1]+" , ")
except:
None
aa += 6
f.write("\n")
f.write("\n")
co = 0
cco = 0
co2 = 0
for j in enumerate(Faces):
f.write(str(j[1])+" , "+iso8859(str(float(FacesSurf[co]) * float(uniteS))+" , "+uniteSs+"\n"))
co += 1

for jj in range(cco,len(FacesCoor)):# Faces coordinates
cco+=1
if FacesCoor[jj] == "T":
f.write("\n")
break
else:
# f.write(FacesCoor[jj][0:3]+" , "+FacesCoor[jj][4:len(FacesCoor[jj])]+" , ")
chaine = str(FacesCoor[jj]).split(":")
f.write(chaine[0]+" , "+chaine[1]+" , ")
co2 += 1
if co2 == 3:
f.write("\n")
co2 = 0

f.write("\n")
f.write(iso8859("Plan :, XY:, " + self.lineEdit_8xy.text() + "," +" coordinates:, " + str(Plan_xy_V)+"\n"))
f.write(iso8859("Plan :, YZ:, " + self.lineEdit_8yz.text() + "," +" coordinates:, " + str(Plan_yz_V)+"\n"))
f.write(iso8859("Plan :, ZX:, " + self.lineEdit_8zx.text() + "," +" coordinates:, " + str(Plan_zx_V)+"\n\n"))
f.write("The form surface :, "+iso8859(str(surface * uniteS)+" , "+uniteSs+"\n"))
f.write("Surface of the face :, "+iso8859(str(surfaceFace * uniteS)+" , "+uniteSs+"\n\n"))
f.write("Volume of the form :, "+iso8859(str(volume_ * uniteV)+" , "+uniteVs+"\n"))
f.write("Weight :, "+iso8859(str(poids)+" , "+unitePs+", Density:, "+str(densite)+"\n\n"))
f.write("Center of the shape :, X:, "+iso8859(str(boundBoxCenterX)+", Y:, "+str(boundBoxCenterY)+", Z:, "+str(boundBoxCenterZ)+"\n"))
f.write("Center of mass :, X:, "+iso8859(str(CenterOfMassX) +", Y:, "+str(CenterOfMassY) +", Z:, "+str(CenterOfMassZ)+"\n"))
f.write("BoundBox :, X:, "+iso8859(str(boundBoxLX * uniteM)+","+uniteMs+", Y:, "+str(boundBoxLY * uniteM)+","+uniteMs+", Z:, "+str(boundBoxLZ * uniteM)+","+uniteMs+"\n\n"))
f.write("Matrix of inertia :, X:, "+iso8859(str(MatrixX1)+", Y:, "+str(MatrixY1)+", Z:, "+str(MatrixZ1)+", :, "+str(Matrix_1)+"\n"))
f.write(" :, X:, "+iso8859(str(MatrixX2)+", Y:, "+str(MatrixY2)+", Z:, "+str(MatrixZ2)+", :, "+str(Matrix_2)+"\n"))
f.write(" :, X:, "+iso8859(str(MatrixX3)+", Y:, "+str(MatrixY3)+", Z:, "+str(MatrixZ3)+", :, "+str(Matrix_3)+"\n"))
f.write(" :, X:, "+iso8859(str(Matrix12)+", Y:, "+str(Matrix13)+", Z:, "+str(Matrix14)+", :, "+str(Matrix15)+"\n"))
f.close()
except:
App.Console.PrintMessage("Error writing file "+SaveName+"\n")
errorDialog("Error writing file "+SaveName)

def on_pushButton_Ra_clicked(self): # clicked() pressed(), released() Bouton radian/degrés
global uniteAs
Plan_xy2 = 0.0
Plan_yz2 = 0.0
Plan_zx2 = 0.0
if self.pushButton_Ra.text() == "Degree":
uniteAs = ""
self.pushButton_Ra.setText(_translate("MainWindow", "DegMinSec", None))
self.lineEdit_8xy.setText(degMinSec(Plan_xy))
self.lineEdit_8yz.setText(degMinSec(Plan_yz))
self.lineEdit_8zx.setText(degMinSec(Plan_zx))
elif self.pushButton_Ra.text() == "DegMinSec":
uniteAs = " rad"
self.pushButton_Ra.setText(_translate("MainWindow", "Radian", None))
Plan_xy2 = radians(Plan_xy)
self.lineEdit_8xy.setText(str(Plan_xy2)+uniteAs)
Plan_yz2 = radians(Plan_yz)
self.lineEdit_8yz.setText(str(Plan_yz2)+uniteAs)
Plan_zx2 = radians(Plan_zx)
self.lineEdit_8zx.setText(str(Plan_zx2)+uniteAs)
elif self.pushButton_Ra.text() == "Radian":
uniteAs = " gon"
self.pushButton_Ra.setText(_translate("MainWindow", "Grade", None))
Plan_xy2 = angleGrade(Plan_xy)
self.lineEdit_8xy.setText(str(Plan_xy2)+uniteAs) #angleGrade
Plan_yz2 = angleGrade(Plan_yz)
self.lineEdit_8yz.setText(str(Plan_yz2)+uniteAs)
Plan_zx2 = angleGrade(Plan_zx)
self.lineEdit_8zx.setText(str(Plan_zx2)+uniteAs)
elif self.pushButton_Ra.text() == "Grade":
uniteAs = u"°"
try:
self.pushButton_Ra.setText(_translate("MainWindow", "Degree", None))
self.lineEdit_8xy.setText(str(Plan_xy)+uniteAs)
self.lineEdit_8yz.setText(str(Plan_yz)+uniteAs)
self.lineEdit_8zx.setText(str(Plan_zx)+uniteAs)
except:
None

def on_pushButton02_clicked(self): # Exit button
App.Console.PrintMessage("End FCInfo\r\n")
FreeCADGui.Selection.removeObserver(s) # Uninstalls the resident function
self.window.hide()
def removeSelection(self,document, object, element): # Delete the selected object
App.Console.PrintMessage("removeSelection"+"\n")
def setSelection(self,document): # Selection inComboView
App.Console.PrintMessage("setSelection"+"\n")
def clearSelection(self,document): # If click on the screen, clear the selection
global sel
App.Console.PrintMessage("clearSelection"+"\n") # If click on another object, clear the previous
sel = ""

#########################################################################################################################
class SelObserver:
def addSelection(self,document, object, element, position): # Sélection
global sel
global document_
global object_
global element_
global position0
global position1
global position2

sel = FreeCADGui.Selection.getSelection()

document_ = document
object_ = object
element_ = element

position0 = position[0]
position1 = position[1]
position2 = position[2]
if len(sel)==0:
App.Console.PrintMessage("Select an object"+"\n")
errorDialog("Select an object")
else:
ff = ui
ff.on_pushButton_Raf_clicked()
#####################################################################################

sel = FreeCADGui.Selection.getSelection()

s=SelObserver()
FreeCADGui.Selection.addObserver(s) # install the function mode resident

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

</syntaxhighlight>

===Omezení===
Pro ukončení vždy používejte tlačítko {{KEY|Exit}}. Ukončení jiným způsobem zapříčiní, že program zůstane v paměti a běží a zobrazuje data v "reportovacím pohledu". Abyste uvolnili pamět, musíte ukončit celý FreeCAD.<br />
V tabulce je viditelných pouze prvních 200 prvků objektu. Je-li jich v objektu více zobrazí se upozornění "'(! +200)" '. Kompletní seznam dat je viditelný v souboru uloženém pomocí tlačítka {{KEY|Save}}.<br />
'''PS : Tato verze není definitivní.'''

project:<br />
<strike>read the file directly in a table.</strike> done<br />
<strike>matches the "Edges" and their coordinates</strike> done<br />
Association of a substance to its density<br />
<strike>inclination on the element rather than the global object</strike> done<br />
a button on the toolbar<br />
inlay right in the interface of FreeCAD


instead:
{{Code|code=
self.window.hide()
}}
and i adding the possibility display or not the "Error Message" window "False" by default, if you wand activate the warning window go to :
{{Code|code=
FreeCAD >Menu >Tools >Edit parameters... >BaseApp/Preferences/Macros/FCMmacros/FCInfo > switchWarning
}}
<div class="mw-translate-fuzzy">
currently:<br />
currently:<br />
*ver 1.21-3.01 , 07/11/2019 # 07/11/2019 ver "01.21-3-rmu" replace character micro = "U", square = "2", cube = "3", degrees = " deg" see "https://forum.freecadweb.org/viewtopic.php?f=3&t=6005&start=70#p345819"
ver 1.10.b , 19/11/2013 buttons outside the scrollbar and the dimensions of the window blocking<br />
*ver 1.21.01 (1.21-rmu) 30/05/2019 rmu change fixed positions to qt layouts grid.addWidget() by rmu75 see the rmu75 fork "https://gist.github.com/rmu75/b165147bd1c2f2659c014103793ae1d8"
*ver 1.20 , 29/01/2018 optimization
*ver 1.19 , 20/01/2018 create checkBox for use detection all elements of the object if wanted or not , the macro is faster. Optimisation
*ver 1.18 , 19/12/2017 ...
*ver 1.17c , 14/12/2017 create plane with coordinate give in one project in other project and replace "FCInfo" by "__title__"
*ver 1.17b , 13/12/2017 little correction replace FCTreeView to FCInfo
*ver 1.17 , 12/12/2017 add upgrade Moment of inertia mm and kg by pinq [https://forum.freecadweb.org/viewtopic.php?t=23888 FCMacro and moment of inertia of assembly], and create plane, axis, point, and add options separator for spreadsheet
*ver 1.16 , 21/06/2017 add control height police (here PointSize 8) and checkbox for position the window to right or left<br />
*ver 1.15 , 19/12/2015 suppression PyQt4 option [http://forum.freecadweb.org/viewtopic.php?f=12&t=13541 see] , add checkBox for editing infos in report view<br />
*ver 1.14 , 04/08/2014 replace PyQt4 and PySide and correct tooltip not displayed cause on PySide and add fg<br />
*ver 1.13 , 27/07/2014 replace FCInfo_en_Ver_1-12_Docked.FCMacro to FCInfo_en_Ver_1-13_Docked.FCMacro accept PyQt4 and PySide<br />
*ver 1.12 , 10/03/2014 adding tooltip<br />
*ver 1.11 , 04/03/2014 adding µm, nm, pm, fm, µg, ng, pg, pourcent, fixed of grandeur carat <strike>"cd"</strike> in '''"ct"''', display of the label and internal name, fixed calculation of angles XY YZ ZX could give an error on a compound shape, window dockable in FreeCAD<br />
*ver 1.10.b , 19/11/2013 buttons outside the scrollbar and the dimensions of the window blocking<br />
(ver 1.10 , 18/11/2013 create scrollbar)<br />
(ver 1.10 , 18/11/2013 create scrollbar)<br />
ver 1.08.b , 10/11/2013 translation units in English, error correction to display the area of the faces listed in the table and replacement of the"'''print'''" by "'''App.Console.PrintMessage'''"<br />
*ver 1.08.b , 10/11/2013 translation units in English, error correction to display the area of the faces listed in the table and replacement of the"'''print'''" by "'''App.Console.PrintMessage'''"<br />
<strike>ver 1.09 , 04/11/2013 works perfectly on Windows and Linux (cause of errors on Linux the characters : ² ³ ° "ordinal not in range(128)") </strike><br />
<strike>ver 1.09 , 04/11/2013 works perfectly on Windows and Linux (cause of errors on Linux the characters : ² ³ ° "ordinal not in range(128)") </strike><br />
In a Linux distribution and in the case of an error of '''"ordinal not in range (128)"''' an alternative version exists on this page [[Macro_FCInfo_Alternate_Linux|Macro_FCInfo_Alternate_Linux]]<br />
In a Linux distribution and in the case of an error of '''"ordinal not in range (128)"''' an alternative version exists on this page [[Macro_FCInfo_Alternate_Linux|Macro_FCInfo_Alternate_Linux]]<br />
ver 1.08 , 24/10/2013 correction of high top "Faces" and "Edges" displaying 100 objects (in the saved file)<br />
*ver 1.08 , 24/10/2013 correction of high top "Faces" and "Edges" displaying 100 objects (in the saved file)<br />
ver 1.07 , 11/10/2013 matches the "Faces" and their coordinates.<br />
*ver 1.07 , 11/10/2013 matches the "Faces" and their coordinates.<br />
ver 1.06 , 22/09/2013 matches the "Edges" and their coordinates, inclination on the element rather than the global object<br />
*ver 1.06 , 22/09/2013 matches the "Edges" and their coordinates, inclination on the element rather than the global object<br />
ver 1.05 , 17/09/2013 added an icon for the spreadsheet, conversion barrel fr, affichage des dimensions overall instead of coordinates.<br />
*ver 1.05 , 17/09/2013 added an icon for the spreadsheet, conversion barrel fr, affichage des dimensions overall instead of coordinates.<br />
ver 1.04 , 11/09/2013: read the file directly in a table.<br />
*ver 1.04 , 11/09/2013: read the file directly in a table.<br />
ver 1.03 , 09/09/2013: clearer display in view report and replacement by "typeObject = sel[0].Shape.ShapeType"<br />
*ver 1.03 , 09/09/2013: clearer display in view report and replacement by "typeObject = sel[0].Shape.ShapeType"<br />
ver 1.02 , 7/09/2013 : small updates<br />
*ver 1.02 , 7/09/2013 : small updates<br />
ver 1.00 , 6/09/2013<br />
*ver 1.00 , 6/09/2013<br />
</div>
You can share your comments on the forum [http://forum.freecadweb.org/viewtopic.php?f=10&t=3185 Info Workbench - Help with icons please.]

<span id="Links"></span>
<div class="mw-translate-fuzzy">
==Odkazy==
Viz také [[Arch Survey/cs|Arch Survey]] [[File:Arch Survey.png|36px|Arch Survey]]
</div>

See Also: [[File:Arch_Survey.svg|36px|Arch Survey]] [[Arch_Survey|Arch Survey]]

Své připomínky můžete sdílet na fóru [http://forum.freecadweb.org/viewtopic.php?f=10&t=3185 Info Workbench - Help with icons please.]<br />
Zde je další příspěvek [http://forum.freecadweb.org/viewtopic.php?f=8&t=6005 FCInfo Macro]


{{clear}}
{{clear}}
<languages/>

Revision as of 11:55, 29 December 2023

Macro FCInfo

Description
Gives information about the selected shape and can display a conversion of length, inclination (degrees, radians, grades, percent), area, volume and weight in different units (metric and imperial). The macro now also works for the elements of a sketch in edit mode.


French Version Version française

Macro version: 1.28c
Last modified: 2023/10/30
FreeCAD version: All
Download: ToolBar Icon
Author: Mario52

Author
Mario52
Download
ToolBar Icon
Links
Macro Version
1.28c
Date last modified
2023/10/30
FreeCAD Version(s)
All
Default shortcut
None
See also
Arch Survey, Macro SimpleProperties, Macro FCInfoGlass

Description

Popis

Dává řadu informací o vybraném tvaru a může zobrazit konverzi délky, sklonu (stupně, radiány, procenta) tělesa, povrchu, objemu a váhy tvaru s měrnou hmotností vybranou v různých jednotkách hmotnosti mezinárodních i Anglo-Saských.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/c18679d096d168133e6f9e914774b3ba06ff6dc9/FCInfo_en_Ver_1-28c-rmu_Docked.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/c18679d096d168133e6f9e914774b3ba06ff6dc9/FCInfo_en_Ver_1-28c-rmu_Docked.FCMacro")


FCInfo

Usage

Použití

Vyberete objekt nebo spustíte aplikaci a vyberete objekt a zobrazí se řada informací. Jeho výpočty založené na jednotce FreeCADu, což je mm pro kažbý nový výběr, vrací vždy délku v mm a úhel v dekadických stupních.

upper window
upper window
lower window

Sector 1: Document

  • Název dokumentu
  • Označení objektu
  • Interní název objektu
  • Název dílčího objektu
  • Typ objektu


Sector 1: Document

FCInfo Document

  • Document name
  • Label and internal name of the object
  • Internal Name of the object
  • Sub element name and type of the object
  • Type of the object

(you can checked to false the variable switch_setVisible_GBox_001_Document for hidden the Box)

Sector 2: Coordinates click mouse

  • Souřadnice X, Y a Z kliknutím myší
  • Tlačítko vytváří na bodové, osové, rovinné, kopírovací vektorové formě osy 'FreeCAD.Vector (-24.0, 240.0, 7.0)'

FCInfo Coordinate

  • Coordinates X,Y and Z click to mouse
  • The button creates point, axis, plane, copy vector axis from FreeCAD.Vector(-24.0, 240.0, 7.0)

(you can checked to false the variable switch_setVisible_GBox_002_Coordinate_Mouse for hidden the Box)

Sector 3: Color on point

FCInfo Color_on_point

Sector 3: Value

  • Délka objektu, je-li objekt obrys obličeje, zobrazí se velikost jednotky:
    km, hm, přehrada, m, dm, cm, 'mm' , μm, fm, palec, propojení, noha, yard, bidélko, řetěz, furlong, míle, ligy, námořní. Je-li objekt kružnicí o jednu sekundu, zobrazí se políčkoEdit a zobrazí poloměr kružnice.
  • Obvod tvaru

Sector 4: Components Mesh

FCInfo Component Mesh

If the selection is a mesh object one new window "Components" is displayed and gives:

  • Edges : number of edges 9561.
  • Faces : number of faces 6374.
  • Points : number of points 3189.

(you can checked to false the variable switch_setVisible_GBox_004_Object_Mesh for hidden the Box)

Sector 5: Units

FCInfo Units

  • mm  : If the object is a face perimeter, length of the object is displayed. Unit size can be selected :
    km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.
  • Length of the object : Length of the object or perimeter of the face 10.0 mm.
  • If the object is a circle, a second lineEdit Radius : is opened and display the radius and diameter of circle 2.0 mm (dia. 4.0 mm).
  • Perimeter of the shape (12). Perimeter of the object and number of subObject (Edges) contained in the object 120.0 mm.

(you can checked to false the variable switch_setVisible_GBox_005_Value_Unit for hidden the Box)

Sector 6: Inclination

FCInfo Inclination

  • Inclination of the object can be displayed in:
    • decimal degree, ex: 174.831872611°
    • degree minute seconde, ex: 174° 49' 54.741401
    • radian, ex: 3.05139181449 rad
    • grade, ex: 194.257636235 gon
    • percent, ex: 30° = 57.74%
  • Inclinations in planes XY, YZ, ZX and their coordinates
  • Direction object, Vector (0.0, 0.0, -10.0) give the direction of object. The calculate is : coord_1 - coord_2 = direction (or reverse)
    • Direction this button create a line in direction of the object.
  • ValueAt(0), Vector (0.0, 0.0, 10.0) returns the 3D vector corresponding to a parameter value.
    • ValueAt(0) this button create a line in ValueAt direction of the object.
  • NormalAt(0,0), Vector (0.0, 0.0, 1.0) returns the 3D vector corresponding to a parameter value.
    • NormalAt(0,0) this button create a line in NormalAt direction of the object.

(you can checked to false the variable switch_setVisible_GBox_006_Inclination for hidden the Box)

Sector 7: Surface and Volume

FCInfo Surface and Volume

  • Surface of the form displayed, unit size can be selected. 600.0 mm2
  • Surface of the face displayed, unit size can be selected. 0.0 mm2
  • Volume of the form displayed, unit size can be selected. 1000.0 mm3
  • Unit , choice your unit.
  • The gram unit mass can be chosen :
    ton,quintal, kg, hg, dag, gram, dg, cg, mg, µg, ng, pg, fg, gr (grain), dr (drachm), oz (once), oz t (once troy),
    lb t (livre troy), lb (livre av), st (stone), qtr (quarter), cwt (hundredweight), tonneau fr, ct.
  • Weight of the form displayed, unit mass can be selected. 2.7 g
  • Density of the material in kg by dm3 2.7000 kg (by dm3)
  • Material Metal Nickel (Ni),8.27,10.0,adapt Price
    • In beginning the macro search the file FCInfo_material.txt, if the file not exist, one file FCInfo_material.txt is created.
    • The file is created with 10 types of material saved in this format.
      • Title of material , Density on dm3 , Price on dm3 , text info on choice
      • (4 fields separate by coma)
      • Liquid Water (H2o),1,10.0,adapt Price
      • Mater Beton,2.4,10.0,adapt Price
      • Metal Aluminium (Al),2.7,10.0,adapt Price
      • Metal Copper (Cu),8.96,10.0,adapt Price
      • Metal Gold (Au),19.3,10.0,Gratis
      • Metal Iron (Fe),7.87,10.0,adapt Price
      • Metal Lead (Pb),11.35,10.0,adapt Price
      • Metal Magnesium (Mg),1.43,10.0,adapt Price
      • Metal Nickel (Ni),8.27,10.0,adapt Price
      • Metal Pewter (Sn),7.29,10.0,adapt Price
      • Metal Platinum (Pt),21.45,10.0,adapt Price
      • Metal Silver (Ag),10.5,10.0,adapt Price
      • Metal Sodium (Na),0.97,10.0,adapt Price
      • Metal Titanium (Ti),4.4,10.0,adapt Price
      • Metal Zinc (Zn),7.1,10.0,adapt Price
      • Wood Beechwood,0.8,10.0,adapt Price
      • Wood MDF,0.75,10.0,adapt Price
      • Wood Mahogany,0.6,10.0,adapt Price
      • Wood Oak,0.7,10.0,adapt Price
      • Wood White pine,0.4,10.0,adapt Price
  • New material or editing Metal Nickel (Ni),8.27,10.0,adapt Price
    • you can modify or edit one new material in this format:
    • Title, Density on dm3, Price on dm3, text info on choice
    • (4 fields separate by coma)
    • you can also edit the file in your favorite editor respecting the specific format
    • you can save the file in a path desired with the variable : seTMaterialSavePathName
    • by default the file is created in the macro path
    • Delete 1/17 : delete the field displayed
    • Save : save the modification or the new material

(you can checked to false the variable switch_setVisible_GBox_007_Surface_and_Volume for hidden the Box)

Sector 8: Cost

FCInfo Cost

  • Cost total : cost total of the object selected

0.027 Eu

  • Price (kg/dm3) : price of the material selected (Metal Aluminium (Al),2.7,10.0,adapt Price)

10,0000 Eu (by Kg)
(you can checked to false the variable switch_setVisible_GBox_008_Cost_And_Price for hidden the Box)

Sector 9: BoundBox

FCInfo BoundBox

  • BoundBox gives extreme dimensions of the shape.
    • maximum X length : 10.0 mm
    • maximum Y length : 10.0 mm
    • maximum Z length : 10.0 mm
    • diagonal length : 17.3205 mm
    • Tracing : create 6 rectangles to dimensions of boundbox
    • Volume : create volume to dimensions of boundbox
    • Text Dim. : create the dimension of the triangle (boundbox)
    • If the Text Dim. is checked, the spinbox dimension of text 3,000 is operational for give your value (3.0 by default)

(you can checked to false the variable switch_setVisible_GBox_009_BoundBox for hidden the Box)

Sector 10: Center of:

FCInfo Center of...

  • Center of the shape and these coordinates XYZ
  • Center of mass and these coordinates XYZ
  • The buttons creates on point, axis, plane, copy vector axis form FreeCAD.Vector(-24.0, 240.0, 7.0) (see Sector 13)

(you can checked to false the variable switch_setVisible_GBox_010_Center_Mass for hidden the Box)

Sector 11: Inertia

FCInfo Inertia

  • Moment of inertia and these coordinates length and weigth
  • The button creates on point, axis, plane, copy vector axis form FreeCAD.Vector(-24.0, 240.0, 7.0) (see Sector 13)
    • action line 1 : x1, y1, z1, 0.0
    • action line 2 : x2, y2, z2, 0.0
    • action line 3 : x3, y3, z3, 0.0
    • action 4 diagonal : x1, y2, z3

same for length and weigth

  • Determinant 1  : 4629629629629.633 computes the determinant of the matrix, in scientific value
  • Determinant 2  : 4629629629629.6328125 computes the determinant of the matrix, in decimal value

(you can checked to false the variable switch_setVisible_GBox_011_Inertia for hidden the Box)

Sector 12: SpreadSheet

FCInfo Disabled

  • Disabled module CheckBox for search or not all details of the object. If it is not checked, only the principal value is displayed.
  • Vertexes and details of the shape (compt_Edge), (compt_Faces), (compt_Vector of the Face)
  • Max 200 lines in the table, if there are more than 200 lines it appears (!+ 200) and the number of lines
  • If the object is complicated with many objects, the time is long and the search is repeated with every mouse click. The write function in the spreadSheet included, decreases the display time for this it is disabled by default
  • Full details can save be the Save button in a file in CSV format and can be viewed the file in spreadsheet with the Read or by an external spreadsheet as LibreOffice OpenOffice or other

(you can checked to false the variable switch_setVisible_GBox_012_SpreadSheet for hidden the Box)

Sector 13: SpreadSheet creation

FCInfo SpreedSheet

  • SpreadSheet : create a new spreadsheet in a document
  • SpreadSheet : the current spreadsheet. if the spreadsheet does not exist one spreadsheet is created
  • Refresh : refresh the list of spreadsheet in document
  • -  : the spreadsheet(s) present in document
  • Read : read the data in a spreadsheet saved .FCInfo or txt, asc, csv
  • Save : save the data in disk in the form selected below .FCInfo or txt, asc, csv
  • Tabulation : the separator is Tabulation (by default)
  • Comma : the separator is Comma
  • Semicolon : the separator is Semicolon
  • Space : the separator is Space

Možnost uložit nebo přečíst tabulku s různým oddělovačem, tabulka, čárka, středník, prostor
Tabulace jsou oddělovač pro modul FreeCAD spreadSheet
Počet těchto čtyř oddělovačů se vypočítá pro pomoc, pokud není známo
COMMA jsou starý (01.16 a dřívější) oddělovač maker FCInfo
Nyní pro kompatibilitu s rozložením FreeCAD spreadSheet a od verze 01.17 je TABULACE implicitně oddělovač
Chcete-li převést vaši starou tabulku FCInfo: Otevřete ji ve složce FCInfo a uložte ji pomocí možnosti Tabulace

Sector 14: Main tools

FCInfo Main

  • Info : if this CheckBox is checked, the informations are displayed in the report view window
  • Point : if checked, one point is created in the coordinate displayed form : FreeCAD.Vector(-24.0, 240.0, 7.0)
  • Axis : if checked, one axis is created in the coordinate displayed form : FreeCAD.Vector(-24.0, 240.0, 7.0)
  • Plane : if checked, one axis plane is created in the coordinate displayed form : FreeCAD.Vector(-24.0, 240.0, 7.0)
  • Clip-B0 : None clipBoard
  • Clip-B1 : If checked the coordinate are copy in the clipBoard Form : FreeCAD.Vector(X.0, Y.0, Z.0) FreeCAD model
  • Clip-B2 : If checked the coordinate are copy in the clipBoard Form : X, Y, Z with Comma separator
  • Clip-B3 : If checked the coordinate are copy in the clipBoard Form : X Y Z as is with Space separator
  • Left/Right : if this CheckBox is not checked, the window macro are displayed to right (default). If it is checked the window macro are displayed to left.
    If the option is 1 mode fly (User parameter:BaseApp/Preferences/Macros/FCMmacros/FCInfo/seTPositionFlyRightLeft) this button is not visible .
  • 4 (Decimales)  : give the number of decimal displayed
  • 12 (Dim. texte)  : give the dimensionof text in the macro
  • Forum  : direction FCInfo forum tread (you must to be connected to internet)
  • Wiki : direction Wiki FCInfo (you must to be connected to internet)
  • Ref  : refresh the display of data in report view
  • Exit : exit properly the macro (not use the red cross of the window)

(you can checked to false the variable switch_setVisible_GBox_014_Main_Tools for hidden the Box)

Po spuštění makra zůstane makro aktivní a okno zůstane viditelné. Chcete-li makro ukončit, stiskněte klávesu Exit. Pokud opustíte kříž, makro zůstane v paměti a data se objeví v zobrazení "sestavy" aplikace FreeCAD.

Options

Volby

Použité jednotky

Délková jednotka:

km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch(palec), link, foot(stopa), yard, perch, chain, furlong, mile, league, nautique.

Length unit:

km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.

Angle degrees :

Úhlové stupně :

  1. dekadické stupně, např: 174.831872611°
  2. stupně minuty vteřiny, např.: 174° 49' 54.741401''
  3. radiány, např.: 3.05139181449 rad
  4. grade, např.: 194.257636235 gon
  5. procenta např.: 30° = 57.74%

Understanding of angles in FCInfo display.

Weight unit :

Váhové jednotky :

ton, quintal, kg, hg, dag, gram, dg, cg, mg, µg, ng, pg, fg, gr (grain), dr (drachm), oz (once), oz t (once troy),
lb t (livre troy), lb (livre av), st (stone), qtr (quarter), cwt (hundredweight), tonneau fr, ct
"spinBox" je nastaven na 7,5 kg, tj. průměrná měrná hmotnost oceli. Chcete-li jinou defaultní (přednastavenou) hodnotu, změňte hodnotu měrné hmotnosti na řádku 208

FCInfo Configuration

  • Location : Tools > Edit parameter > *User parameter:BaseApp/Preferences/Macros/FCMmacros/FCInfo/
  • switchNotInfoOnBeginning # SetBool true or [false]
    • Display or not this text information on run macro
      • [false] = display this information
      • true = this Information is Not displayed On Beginning
  • switchVersionSearch # SetBool true or [false]
    • Search if one new version exist on run macro
  • switchWarning # SetBool true or [false]
    • Display or not display the window warning in case not good selection
  • switchCreatePoint # SetBool true or [false]
    • Check the Create point checkBox
  • switchCreateAxis # SetBool true or [false]
    • Check the Create axis checkBox
  • switchCreatePlane # SetBool true or [false]
    • Check the Create plane checkBox
  • switchDisplayInfoObject # SetBool true or [false]
    • Check the info checkBox
  • switchClearDisplayReportView # SetBool true or [false]
    • if switchClearDisplayReportView is true the ReportView is cleared
  • seTWidgetPosition # SetBool true or [false]
    • Check the Widget Position Left/Right checkBox
    • if seTWidgetPosition [false] : if seTPositionFlyRightLeft = 2 = docked to Right
    • if seTWidgetPosition true  : if seTPositionFlyRightLeft = 3 = docked to Left
    • if it is 1 the window macro is not docked
  • switchBoundBoxCreateText # SetBool true or [false]
    • Create the text dimension of the BoundBox
  • seTBoundBoxTextHeigth # seTBoundBoxTextHeigth = 3.0
    • Give the Heigth of the text dimension (independent of the seTTextHeigthValue)
  • seTBoundBoxTextArround # seTBoundBoxTextArround = 3
    • Give the arround of the text dimensions (independent of the seTDecimalValue)
  • seTMemoClipBoard # SetInt [0], 1, 2, 3
    • Give one value [0], 1, 2, 3 clipBoard
      • [0] = desactivate the clipBoard
      • 1 = the data string is memorised to : FreeCAD.Vector( X, Y, Z )
      • 2 = the data string is memorised to : X, Y, Z
      • 3 = the data string is memorised to : X Y Z
  • seTTextHeigthValue # SetInt 11
    • Give one text heigth value of the macro
  • seTDecimalValue # SetInt 4
    • Give the number of decimal displayed
    • If the number is -1 the total decimal value is displayed)
  • seTMaterialCurrentIndex # SetInt 0
    • Set the index of the ComboBox
  • seTMaterialFileName # SetString FCInfo_material.txt
    • Name of the material file
  • seTMaterialSavePathName # SetString C:\...\Macro\FCInfo_material.txt
    • Path name of the material file
  • seTMaterialPrice # SetFloat
    • Material price by Kg
  • seTMaterialSuffixDevise # SetString
    • Devise money
  • seTMaterialSuffixCost # seTMaterialSuffixCost
    • Suffix Devise cost
  • seTMaterialCost # SetFloat
    • Material cost
  • seTDensiteValue # SetFloat 1.0
    • Give the densite value
  • seTDensiteDecimalNumber # SetInt 4
    • Give the number of decimal for the densite value
  • seTDensiteSingleStep # SetFloat 1.0
    • Give the step for one click, by default 1.0 (possible 0.01 or ...)
  • seTDensiteSuffixChain # SetString kg (by dm3)
    • Choice your suffix string
  • seTPositionFlyRightLeft # SetInt 2
    • Choice your position, Fly, [Right], Left
      • 1 = the macro window is fly (not docked)
      • [2] = the macro window is positioned to Right
      • 3 or other = the macro window is positioned to Left
  • seTIndexUnitWeight # SetInt
    • Set unit Weight index
  • seTUnitSymbolMicro # U
    • Set Symbol Micro
  • seTUnitSymbolCube # 3
    • Set Symbol Cube
  • seTUnitSymbolCarre # 2
    • Set Symbol Square
  • seTIndexUnitLength # SetInt
    • Set unit Length index
  • setBSplineToByArcValue # SetFloat 0.00001
    • Set unit for cut the BSpline for seack the radius on point given
  • setMeshTopologyValue # SetFloat 0.1
    • Set unit for create the Mesh to Shape
  • switchBSplineCreateCircleConstructorAxis #SetBool true or [false]
    • Display the axis of the circles (arcs) for create the BSpline
  • switchBSplineCreateCircleConstructor #SetBool true or [false]
    • Display the circles cretors for create the BSpline
  • switchCreateLineDiVatNatOnClick #SetBool true or [false]
    • Create the Line info on point (0,0,0) or on point mouse clicked (x,y,z) if it is true
    • If it is true one '*' is displayed in front of text. EX: '*Direction'


This switch (section GroupBox) allows you to view only the desired section(s) (just visual) false or true.

All calculations are done without taking account of this option

  • section GroupBox begin
    • switch_setVisible_GBox_001_Document = True (1)
    • switch_setVisible_GBox_002_Coordinate_Mouse = True (1)
    • switch_setVisible_GBox_003_Color = True (1)
    • switch_setVisible_GBox_004_Object_Mesh = True (1)
    • switch_setVisible_GBox_005_Value_Unit = True (1)
    • switch_setVisible_GBox_006_Inclination = True (1)
    • switch_setVisible_GBox_007_Surface_and_Volume = True (1)
    • switch_setVisible_GBox_008_Cost_And_Price = True (1)
    • switch_setVisible_GBox_009_BoundBox = True (1)
    • switch_setVisible_GBox_010_Center_Mass = True (1)
    • switch_setVisible_GBox_011_Inertia = True (1)
    • switch_setVisible_GBox_012_SpreadSheet = True (1)
    • switch_setVisible_GBox_013_SpreadSheet_Creation = True (1)
    • switch_setVisible_GBox_014_Main_Tools = True (1)
  • section GroupBox end

Skript

Zkopírujte obsah tohoto makra do souboru nazvaného "FCInfo.FCMacro" (ve Windowsech) do "C:\Program Files\FreeCAD0.13".
Nebo přímo do okna FreeCADu
Ikona musí být ve stejném adresáři jako je makro pro Windows "C:\Program Files\FreeCAD0.13".
Stáhněte umístění obrázků u ikon a pravým tlačítkem je "Uložte jako" (neměňte jméno) (originál - Download image positioning on the icon and then drag the mouse right click "save as" (do not change the name))

Copy the contents of the macro in a file named "FCInfo.FCMacro"

  • Windows: the form is usually " drive:\Users\your_user_name\AppData\Roaming\FreeCAD\ "
  • Ubuntu: the form is usually " /home/your_user_name/.FreeCAD ".

Or, directly in the interface of FreeCAD
The icon must be in the same directory as the macro.
Download image positioning on the icon and then drag the mouse right click "save as" (do not change the name)

PS: příliš dlouhá na to, aby byla obsažena na stránce wiki (zatím jsou stránky wiki pouze 64 KB) kód makra byl umístěn na fóru

Stáhněte soubor makra na podstavec ukotvený vpravo

(Nebo On the forum.)

PS: toto makro používá getSelection () a seznam objektů začíná na 1 ex: pro pole 'Edge1 to Edge12' a kód v konzole začíná na 0 ex: pro rámeček Edge [0] na Edge [11]
To je normální počítání na matici / seznamy uvnitř OpenCascade vždy začíná na 1 a ne na 0

Limitations

Omezení

Pro ukončení vždy používejte tlačítko Exit. Ukončení jiným způsobem zapříčiní, že program zůstane v paměti a běží a zobrazuje data v "reportovacím pohledu". Abyste uvolnili pamět, musíte ukončit celý FreeCAD.
V tabulce je viditelných pouze prvních 200 prvků objektu. Je-li jich v objektu více zobrazí se upozornění "'(! +200)" '. Kompletní seznam dat je viditelný v souboru uloženém pomocí tlačítka Save.

Pokud je makro okna po spuštění neviditelné, podívejte se do dolního okna:


projekt:
si přečtěte soubor přímo v tabulce. provedeno
odpovídá okraji a jejich souřadnic , které byly provedeny
Sdružení látky s její hustotou
sklon k prvku spíše než globální objekt proveden
vložte přímo do rozhraní FreeCADu do

Version

ver 1.28b 1.28c 2023/10/30 orthographe

ver 1.28 01/09/2023 modify variable name, possibility hidden each sector, save data spreadSheet in document, surface radius, add button webWiki and webForum

ver 1.27 2023/06/30 optimize the styleSheet, correct the left/right position and restore view after edition sketcher

self.PB_00_Decrement.setStyleSheet("background-color: white; border:2px solid rgb(215, 10, 22);")      # bord white and red

replaced by

self.PB_00_Decrement.setStyleSheet("QPushButton {background-color: white; border:2px solid rgb(215, 10, 22)};")      # bord white and red
  • ver 1.22 , 12/11/2020 : now the macro is totally uninstalled i use :
  • ver 1.26b 20/02/2022 upgrade for detect BSpline in SubObject
  • ver 1.26 06/02/2022 add info on Mesh and Points objects, decode colours, duplicate object or subObject, memorize the latest path and other preferences options
  • ver 1.25e 18/12/2021 add info detailed to BSpline (ToByArcs) and info "sel[0].TypeId"
  • ver 1.25d 12/12/2021 ---
  • ver 1.25c 12/12/2021 correct "strAround((" by "str(Around(" and other little ...
  • ver 1.25b 11/12/2021 correction error in change/modify new material and reorganization
  • ver 1.25 10/12/2021 PySide2 and add comboBox materials
  • ver 1.24 02/12/2021 add adjustedGlobalPlacement modified by edwilliams16 for placement with Body, boundbox tracing
  • ver 1.23cb 25/11/2021 delete "import Sketcher * " create conflict with "open(OpenName, "r")" ??

Adding

FreeCAD.ActiveDocument.openTransaction(u"FCInfo")    # memorise les actions (avec annuler restore)
FreeCAD.ActiveDocument.commitTransaction()           # restore les actions  (avec annuler restore)
#FreeCAD.ActiveDocument.abortTransaction()            # abandonne les actions(avec annuler restore)
  • ver 1.25d, 13/12/2021 little correction material field uncomment the "'try...Except" !!!
  • ver 1.25c, 12/12/2021 little correction new material
  • ver 1.23b, 20/11/2021 little correction, add text info in beginning run macro, and ordinal the text code
  • ver 1.23 , 19/11/2021 include icon in macro, number decimal displayed, text height, configure options in the Preference FC, correct info for elements of sketch in edit mode.
  • ver 1.22 , 12/11/2020 : now the macro is totally uninstalled i use :
try:
        self.window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)    # destroy
        self.window.deleteLater()                                     # destroy
        self.window.destroy()                                         # destroy
except Exception:
        None

How do i exit from FreeCAD instead of Python?

instead:

self.window.hide()

and i adding the possibility display or not the "Error Message" window "False" by default, if you wand activate the warning window go to :

FreeCAD >Menu >Tools >Edit parameters... >BaseApp/Preferences/Macros/FCMmacros/FCInfo > switchWarning

currently:

  • ver 1.21-3.01 , 07/11/2019 # 07/11/2019 ver "01.21-3-rmu" replace character micro = "U", square = "2", cube = "3", degrees = " deg" see "https://forum.freecadweb.org/viewtopic.php?f=3&t=6005&start=70#p345819"
  • ver 1.21.01 (1.21-rmu) 30/05/2019 rmu change fixed positions to qt layouts grid.addWidget() by rmu75 see the rmu75 fork "https://gist.github.com/rmu75/b165147bd1c2f2659c014103793ae1d8"
  • ver 1.20 , 29/01/2018 optimization
  • ver 1.19 , 20/01/2018 create checkBox for use detection all elements of the object if wanted or not , the macro is faster. Optimisation
  • ver 1.18 , 19/12/2017 ...
  • ver 1.17c , 14/12/2017 create plane with coordinate give in one project in other project and replace "FCInfo" by "__title__"
  • ver 1.17b , 13/12/2017 little correction replace FCTreeView to FCInfo
  • ver 1.17 , 12/12/2017 add upgrade Moment of inertia mm and kg by pinq FCMacro and moment of inertia of assembly, and create plane, axis, point, and add options separator for spreadsheet
  • ver 1.16 , 21/06/2017 add control height police (here PointSize 8) and checkbox for position the window to right or left
  • ver 1.15 , 19/12/2015 suppression PyQt4 option see , add checkBox for editing infos in report view
  • ver 1.14 , 04/08/2014 replace PyQt4 and PySide and correct tooltip not displayed cause on PySide and add fg
  • ver 1.13 , 27/07/2014 replace FCInfo_en_Ver_1-12_Docked.FCMacro to FCInfo_en_Ver_1-13_Docked.FCMacro accept PyQt4 and PySide
  • ver 1.12 , 10/03/2014 adding tooltip
  • ver 1.11 , 04/03/2014 adding µm, nm, pm, fm, µg, ng, pg, pourcent, fixed of grandeur carat "cd" in "ct", display of the label and internal name, fixed calculation of angles XY YZ ZX could give an error on a compound shape, window dockable in FreeCAD
  • ver 1.10.b , 19/11/2013 buttons outside the scrollbar and the dimensions of the window blocking

(ver 1.10 , 18/11/2013 create scrollbar)

  • ver 1.08.b , 10/11/2013 translation units in English, error correction to display the area of the faces listed in the table and replacement of the"print" by "App.Console.PrintMessage"

ver 1.09 , 04/11/2013 works perfectly on Windows and Linux (cause of errors on Linux the characters : ² ³ ° "ordinal not in range(128)")
In a Linux distribution and in the case of an error of "ordinal not in range (128)" an alternative version exists on this page Macro_FCInfo_Alternate_Linux

  • ver 1.08 , 24/10/2013 correction of high top "Faces" and "Edges" displaying 100 objects (in the saved file)
  • ver 1.07 , 11/10/2013 matches the "Faces" and their coordinates.
  • ver 1.06 , 22/09/2013 matches the "Edges" and their coordinates, inclination on the element rather than the global object
  • ver 1.05 , 17/09/2013 added an icon for the spreadsheet, conversion barrel fr, affichage des dimensions overall instead of coordinates.
  • ver 1.04 , 11/09/2013: read the file directly in a table.
  • ver 1.03 , 09/09/2013: clearer display in view report and replacement by "typeObject = sel[0].Shape.ShapeType"
  • ver 1.02 , 7/09/2013 : small updates
  • ver 1.00 , 6/09/2013

Odkazy

Viz také Arch Survey Arch Survey

See Also: Arch Survey Arch Survey

Své připomínky můžete sdílet na fóru Info Workbench - Help with icons please.
Zde je další příspěvek FCInfo Macro