Gives a series of informations about the selected shape and can display a conversion of length, inclination (degrees, radians, grades, pourcent) shape, surface, volume and the weight of the form in the density selected in different units of quantities international and Anglo-Saxon. (English version)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
*************************************************************************** | |
* Copyright (c) <mario52> 2014 2015 2016 2017 2018 2019 2020 2021 2022 * | |
* * | |
* 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. * | |
** ** | |
* Use at your own risk. The author assumes no liability for data loss. * | |
* It is advised to backup your data frequently. * | |
* If you do not trust the software do not use it. * | |
** ** | |
* 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 en | |
# 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 | |
# | |
# 05_01 01/14 Docked PyQt4 + PySide 19/12/2015 suppression de PyQt4 21/06/2017 ajout style 8 points et nouveau path | |
# 12/12/2017 upgrade de la section Matrix of inertia de "pinq" voir "https://forum.freecadweb.org/viewtopic.php?f=22&t=23888" | |
# ajout de Plans, Axes, Points et optimisation | |
# 16/04/2019 upgrade pour 0.17.13541 (Git), 0.18.16093 (Git), 0.19.16474 (Git)Qt: 5.6.2 Python: 3.6.6 OCC: 7.3.0 | |
# 30/05/2019 ver "01.21-rmu" rmu change fixed positions to qt layouts grid.addWidget() by rmu75 see the rmu75 fork "https://gist.github.com/rmu75/b165147bd1c2f2659c014103793ae1d8" | |
# 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" | |
# 12/11/2020 ver "01.22-rmu" replace self window(hide) by "self.window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)" | |
# 18/11/2021 ver "01.23 rmu" ajout icones, RB clipBoard, Decimal, Hauteur texte, compatible Sketcher editeur ouvert | |
# 25/11/2021 ver "01.23cb rmu" delete "import Sketcher * " create conflict with open(OpenName, "r") ?? | |
# 02/12/2021 ver "01.24 rmu" add adjustedGlobalPlacement(,), boundbox tracing | |
# 10/12/2021 ver "01.25 rmu" PySide2 and add comboBox materials | |
# 11/12/2021 ver "01.25b, 12/12/2021 ver "01.25c, 13/12/2021 ver "01.25d, 2021/12/27 ver "1.25e" | |
# 2022/02/06 ver "1.26" Mesh, Points, Couleurs, 2022/02/20 ver 1.26b upgrade BSPline, 2022/04/19 ver 1.26c upgrade BSpline error with Gear Bspline=Line | |
# | |
#OS: Windows 10 Version 2009 | |
#Word size of FreeCAD: 64-bit | |
#Version: 0.20.26858 (Git) | |
#Build type: Release | |
#Branch: master | |
#Hash: e209bc706d35121098f9bac779bc6b09c24ddd95 | |
#Python version: 3.8.6+ | |
#Qt version: 5.15.2 | |
#Coin version: 4.0.1 | |
#OCC version: 7.5.3 | |
#Locale: French/Mars (fr_MA) | |
# | |
__Title__ = "FCInfo" | |
__Author__ = "Mario52" | |
__Url__ = "https://gist.github.com/mario52a/8d40ab6c018c2bde678f" | |
__Version__ = "1.26c" | |
__Date__ = "2022/04/19" #YYY/MM/DD | |
__Comment__ = "gives different information about the selected object with the possibility of saving information" | |
__Web__ = "http://forum.freecadweb.org/viewtopic.php?f=10&t=3185"+"https://forum.freecadweb.org/viewtopic.php?f=3&t=6005" | |
__Wiki__ = "https://www.freecadweb.org/wiki/Macro_FCInfo" | |
__Gist__ = "https://gist.github.com/mario52a/6afc64081c4eb8be3b93" | |
__IconL__ = "" | |
__IconW__ = "" | |
__Help__ = "Start the macro select an object and read the info displayed" | |
__Status__ = "stable" | |
__Requires__ = "freecad 0.18 and more" | |
__Communication__ = "http://forum.freecadweb.org/viewtopic.php?f=10&t=3185" | |
# | |
import PySide2 | |
from PySide2 import QtGui , QtCore, QtWidgets | |
from PySide2.QtWidgets import QComboBox | |
from PySide2.QtWidgets import QMessageBox | |
from PySide2.QtWidgets import QTableWidget, QApplication | |
from PySide2.QtGui import * | |
from PySide2.QtCore import * | |
from PySide2.QtWidgets import * | |
#import PySide2.QtXml | |
import os | |
import platform | |
import Draft, Part, FreeCAD, PartGui, FreeCADGui | |
import FreeCAD as App | |
import FreeCADGui as Gui | |
from FreeCAD import Base | |
import Sketcher | |
import Points | |
import Mesh | |
import pivy | |
from pivy import coin | |
import math | |
import decimal | |
from math import sqrt, pi, sin, cos, asin, acos, atan, atan2, degrees, radians, tan | |
import csv | |
import codecs | |
import sys | |
####path######################################################################### | |
global path ; path = "" # | |
#path = FreeCAD.ConfigGet(u"AppHomePath") # path FreeCAD installation | |
#path = FreeCAD.ConfigGet(u"UserAppData") # path FreeCAD User data | |
#path = "your path" # your directory path | |
param = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macro")# macro path | |
path = param.GetString(u"MacroPath","") + "/" # macro path | |
path = path.replace(u"\\","/") # convert the "\" to "/" | |
#print( u"Path for the icons : " , path ) # | |
################################################################################# | |
import WebGui | |
#### Detect version macro ########################################### #22/03/2021 | |
import urllib | |
from urllib import request | |
#### Detect version macro ########################################### #22/03/2021 | |
def vesionSearch(): | |
try: | |
contentPage = request.urlopen(u"https://wiki.freecadweb.org/Macro_" + __Title__).readlines() | |
versionDetect = dateDetect = "" | |
effacer = 0 | |
for i in contentPage: | |
if "ctEven macro-version" in str(i): | |
versionDetect = str((str(i).split(">")[1])) | |
versionDetect = versionDetect.split("\\")[0] | |
if "ctEven macro-date" in str(i): | |
dateDetect = str((str(i).split(">")[1])) | |
dateDetect = dateDetect.split("\\")[0] | |
if (versionDetect != "") and (dateDetect != ""): | |
break | |
try: | |
if (versionDetect == __Version__) and (dateDetect == __Date__): | |
None | |
else: | |
msg = (u"New version availlable : " + "\n" + | |
str(versionDetect) + ":" + str(dateDetect) + "\n" + | |
"You can install with AddonManager" + "\n" + | |
"For desactivate this Info window go to " + "\n" + | |
"parameter:BaseApp/Preferences/Macros/FCMmacros/FCInfo " + "\n" + | |
"set the [ switchVersionSearch ] parameter to False") | |
App.Console.PrintMessage(u"your actual version : " + str(__Version__) + " : " + str(__Date__) + "\n") | |
App.Console.PrintMessage(u"new version availlable : " + str(versionDetect) + " : " + str(dateDetect) + "\n") | |
diag = QtWidgets.QMessageBox(QtWidgets.QMessageBox.Information, 'New Version', msg) | |
diag.setWindowModality(QtCore.Qt.ApplicationModal) | |
diag.setWindowFlags(PySide2.QtCore.Qt.WindowStaysOnTopHint) # PySide2 cette fonction met la fenetre en avant | |
diag.exec_() | |
except Exception: | |
None | |
return versionDetect, dateDetect | |
except Exception: | |
App.Console.PrintError(u"Not search version not connected for testing or internal error" + "\n") | |
global switchVersionSearch; switchVersionSearch = 0 # Search version switchable in | |
# Tools/Edit parameter/BaseApp/Preferences/Macros/FCMmacros/FCCircularText | |
switchVersionSearch = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchVersionSearch") | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool(u"switchVersionSearch", switchVersionSearch) #*True or False | |
if switchVersionSearch == 1: | |
vesionSearch() | |
#### Detect version macro ########################################### | |
try: | |
_fromUtf8 = QtCore.QString.fromUtf8 | |
except AttributeError: | |
def _fromUtf8(s): | |
return s | |
try: | |
_encoding = QtWidgets.QApplication.UnicodeUTF8 | |
def _translate(context, text, disambig): | |
return QtWidgets.QApplication.translate(context, text, disambig, _encoding) | |
except AttributeError: | |
def _translate(context, text, disambig): | |
return QtWidgets.QApplication.translate(context, text, disambig) | |
#################################################################################### | |
def iso8859(encoder): | |
# ori 0.18 Py 27 return unicode(encoder).encode('iso-8859-1') | |
verPython = sys.version_info | |
if int(verPython.major) < 3: | |
return unicode(encoder).encode('iso-8859-1') | |
else: | |
encoder = str(encoder) | |
return encoder | |
def utf8(unio): | |
return unicode(unio).encode('UTF8') | |
def heure(): | |
return QtCore.QTime().currentTime().toString('hh:mm:ss') | |
def dateEu(): | |
return QtCore.QDate().currentDate().toString('dd/MM/yyyy') # forme euro | |
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" | |
def Around(a) : | |
global seTDecimalValue | |
if seTDecimalValue == -1: | |
seTDecimalValue = 1000 | |
ard = round(a, seTDecimalValue) | |
return ard | |
global uniteAs ; uniteAs = " deg" # HTML: ° | |
def degMinSec(angle0): | |
# give the angle in degrees | |
global uniteAs | |
try: | |
deg = int(angle0) | |
min = int((angle0 - deg)*60) | |
sec = Around((((angle0 - deg)*60)-min)*60) | |
angle = str(deg)+" deg"+" "+str(min)+u"' "+str(sec)+u"''" | |
uniteAs = "" | |
return angle | |
except Exception: | |
return 0 | |
def angleGrade(angle0): | |
# give the angle in degrees | |
global uniteAs | |
try: | |
angle = float(angle0) | |
angle = (200.0 * angle) / 180.0 | |
uniteAs = " gon" | |
#return round(angle,6) | |
return angle | |
except Exception: | |
return 0 | |
def anglePourcent(angle0): | |
# give the angle in degrees | |
global uniteAs | |
#angle0 = round(abs(angle0)) | |
angle0 = abs(angle0) | |
if (angle0 == 90): | |
return 0.0 | |
else: | |
try: | |
if angle0 in range(90 ,181): angle0 = 180 - angle0 | |
if angle0 in range(180,271): angle0 = angle0 - 180 | |
if angle0 in range(270,361): angle0 = 360 - angle0 | |
#angle = abs(round((tan(radians(angle0))*100),2)) | |
angle = abs(tan(radians(angle0))*100) | |
uniteAs = u"%" | |
#return round(angle,6) | |
return angle | |
except Exception: | |
return 0.0 | |
def angle2(vecteur_x1, vecteur_y1, vecteur_x2, vecteur_y2, modeTypeAngle): | |
# calculation of the slope of a line using two vectors | |
# If 'modeTypeAngle' = 1 then display in degrees else in radians | |
global uniteAs | |
try: | |
deltaX = vecteur_x2 - vecteur_x1 | |
deltaY = vecteur_y2 - vecteur_y1 | |
if modeTypeAngle == 1: | |
angle = degrees(atan2(float(deltaY),float(deltaX))) # degrees | |
uniteAs = " deg" | |
else: | |
angle = atan2(float(deltaY),float(deltaX)) # radian | |
uniteAs = " rad" | |
#return round(angle,6) | |
return angle | |
except Exception: | |
return 0 | |
#### Configuration begin ################################################ | |
#### NOT MODIFY THE CODE HERE #### | |
#### for modify : go to : FreeCAD >Menu >Tools >Edit parameters... >BaseApp/Preferences/Macros/FCMmacros/FCInfo #### | |
## | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetString(u"Version", __Version__ + " (" + __Date__ + ")") | |
## | |
global switchNotInfoOnBeginning # switchNotInfoOnBeginnin = 0 # display or not the inf on beginning run macro False | |
switchNotInfoOnBeginning = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchNotInfoOnBeginning") | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool(u"switchNotInfoOnBeginning", switchNotInfoOnBeginning) #*True or False | |
## | |
global switchWarning # display or not the little window "Warning Error Selection" | |
switchWarning = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchWarning") | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool(u"switchWarning", switchWarning) #*True or False | |
#Config | |
global switchCreatePoint #; switchCreatePoint = 0 # for point False | |
switchCreatePoint = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchCreatePoint") | |
## | |
global switchCreateAxis #; switchCreateAxis = 1 # for axis True | |
switchCreateAxis = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchCreateAxis") | |
## | |
global switchCreatePlane #; switchCreatePlane = 1 # for plane True | |
switchCreatePlane = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchCreatePlane") | |
## | |
global switchDisplayInfoObject #; switchDisplayInfoObject = 0 # | |
switchDisplayInfoObject = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchDisplayInfoObject") | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool(u"switchDisplayInfoObject", switchDisplayInfoObject) #*True or False | |
## | |
global switchClearDisplayReportView #; switchClearDisplayReportView = 0 # | |
switchClearDisplayReportView = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchClearDisplayReportView") | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool(u"switchClearDisplayReportView", switchClearDisplayReportView) #*True or False | |
## | |
global seTWidgetPosition #; seTWidgetPosition = 0 # position the widget Left or Right | |
seTWidgetPosition = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"seTWidgetPosition") | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool(u"seTWidgetPosition", seTWidgetPosition) # True or False | |
## | |
global switchBoundBoxCreateText #; switchBoundBoxCreateText = 0 # | |
switchBoundBoxCreateText = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchBoundBoxCreateText") | |
## | |
global seTBoundBoxTextHeigth #; seTBoundBoxTextHeigth = 3.0 # | |
seTBoundBoxTextHeigth = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetFloat(u"seTBoundBoxTextHeigth") | |
if seTBoundBoxTextHeigth == 0: seTBoundBoxTextHeigth = 3.0 | |
## | |
global seTBoundBoxTextArround #; seTBoundBoxTextArround = 3 # | |
seTBoundBoxTextArround = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt(u"seTBoundBoxTextArround") | |
if seTBoundBoxTextArround == 0: seTBoundBoxTextArround = 3 | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetInt(u"seTBoundBoxTextArround", seTBoundBoxTextArround) # 3 | |
## | |
global seTMemoClipBoard #; seTMemoClipBoard = 0 # seT format du memo 0=None ou 1=F...CAD(1,1,1) ou 2=1,1,1 ou 3=1 1 1 | |
seTMemoClipBoard = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt(u"seTMemoClipBoard") | |
## | |
global seTTextHeigthValue #; seTTextHeigthValue = 11 # heigth Text value | |
seTTextHeigthValue = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt(u"seTTextHeigthValue") | |
if seTTextHeigthValue == 0: seTTextHeigthValue = 11 | |
## | |
global seTDecimalValue #; seTDecimalValue = 4 # number of decimal value | |
seTDecimalValue = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt(u"seTDecimalValue") | |
if seTDecimalValue == 0: seTDecimalValue = 4 | |
## | |
global seTMaterialCurrentIndex #; seTMaterialCurrentIndex = ? # index materiel | |
seTMaterialCurrentIndex = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt(u"seTMaterialCurrentIndex") | |
## | |
global seTMaterialFileName #; seTMaterialFileName = u"FCInfo_material.txt" or other | |
seTMaterialFileName = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetString(u"seTMaterialFileName") | |
if seTMaterialFileName == "": seTMaterialFileName = u"FCInfo_material.txt" | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetString(u"seTMaterialFileName", seTMaterialFileName) #*"FCInfo_material.txt" | |
## | |
#### new version since 1.25f separate path and name of file more logic 28/01/2022 the parameter/Preferences is not compatible "you must delete the name file and extension in preferences" | |
global seTMaterialReadPathName #; seTMaterialReadPathName = path | |
global seTMaterialSavePathName #; seTMaterialSavePathName = path | |
seTMaterialSavePathName = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetString(u"seTMaterialSavePathName") | |
if seTMaterialSavePathName == "": seTMaterialSavePathName = path | |
seTMaterialSavePathName = os.path.dirname(seTMaterialSavePathName) + "/" # = C:/Provisoire400/ | |
seTMaterialReadPathName = seTMaterialSavePathName | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetString(u"seTMaterialSavePathName", seTMaterialSavePathName) #*"C:\...\Macro\" | |
## | |
global seTMaterialPrice #; seTMaterialPrice = 1.0 # price | |
seTMaterialPrice = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetFloat(u"seTMaterialPrice") | |
if seTMaterialPrice == 0: seTMaterialPrice = 0.0 | |
## | |
global seTMaterialSuffixDevise #; seTMaterialSuffixDevise = " Eu # Suffix Devise | |
seTMaterialSuffixDevise = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetString(u"seTMaterialSuffixDevise") | |
if seTMaterialSuffixDevise == "": seTMaterialSuffixDevise = " Eu (by Kg)" | |
## | |
global seTMaterialSuffixCost #; seTMaterialSuffixCost = " Eu # Suffix Cost | |
seTMaterialSuffixCost = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetString(u"seTMaterialSuffixCost") | |
if seTMaterialSuffixCost == "": seTMaterialSuffixCost = " Eu" | |
## | |
global seTMaterialCost #; seTMaterialCost = 1.0 # (by Kg) | |
seTMaterialCost = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetFloat(u"seTMaterialCost") | |
if seTMaterialCost == 0: seTMaterialCost = 1.0 | |
## | |
global seTDensiteValue #; seTDensiteValue = 1.0 # (steel = 7,32 to 7,86 kg by dm3) | |
seTDensiteValue = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetFloat(u"seTDensiteValue") | |
if seTDensiteValue == 0: seTDensiteValue = 1.0 | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetFloat(u"seTDensiteValue", seTDensiteValue) | |
## | |
global seTDensiteDecimalNumber #; seTDensiteDecimalNumber = 4 # number of decimal value | |
seTDensiteDecimalNumber = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt(u"seTDensiteDecimalNumber") | |
if seTDensiteDecimalNumber == 0: seTDensiteDecimalNumber = 4 | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetInt(u"seTDensiteDecimalNumber", seTDensiteDecimalNumber) #*4 | |
## | |
global seTDensiteSingleStep #; seTDensiteSingleStep = 1.0 # increse step | |
seTDensiteSingleStep = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetFloat(u"seTDensiteSingleStep") | |
if seTDensiteSingleStep == 0: seTDensiteSingleStep = 1.0 | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetFloat(u"seTDensiteSingleStep", seTDensiteSingleStep) #*1.0 | |
## | |
global seTIndexUnitWeight ; seTIndexUnitWeight = 0 # item Poids | |
#seTIndexUnitWeight = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt(u"seTIndexUnitWeight") | |
## | |
global seTIndexUnitLength ; seTIndexUnitLength = 0 # item Longueur | |
#seTIndexUnitLength = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt(u"seTIndexUnitLength") | |
## | |
global seTPositionFlyRightLeft #; seTPositionFlyRightLeft = 2 # 1 = fly, 2 = RightDock other= LeftDock | |
seTPositionFlyRightLeft = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetInt(u"seTPositionFlyRightLeft") | |
if seTPositionFlyRightLeft == 0: seTPositionFlyRightLeft = 2 | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetInt(u"seTPositionFlyRightLeft", 2) #*1, 2, other | |
## | |
global seTUnitSymbolMicro #; seTUnitSymbolMicro = u"U" # micro hex="\xB5", html=<span>µ</span> | |
seTUnitSymbolMicro = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetString(u"seTUnitSymbolMicro") | |
if seTUnitSymbolMicro == "": seTUnitSymbolMicro = "U" | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetString(u"seTUnitSymbolMicro", seTUnitSymbolMicro) #*"U" | |
## | |
global seTUnitSymbolCube #; seTUnitSymbolCube = u"3" # cube hex="\xb3", html=<span>³</span> | |
seTUnitSymbolCube = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetString(u"seTUnitSymbolCube") | |
if seTUnitSymbolCube == "": seTUnitSymbolCube = "3" | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetString(u"seTUnitSymbolCube", seTUnitSymbolCube) #*"3" | |
## | |
global seTDensiteSuffixChain #; seTDensiteSuffixChain = kg # Suffix (by dm3) | |
seTDensiteSuffixChain = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetString(u"seTDensiteSuffixChain") | |
if seTDensiteSuffixChain == "": seTDensiteSuffixChain = " kg (by dm)" + seTUnitSymbolCube | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetString(u"seTDensiteSuffixChain", seTDensiteSuffixChain) #*" kg (by dm3)" | |
## | |
global seTUnitSymbolCarre #; seTUnitSymbolCarre = u"2" # carre hex="\xb2", html=<span>²</span> | |
seTUnitSymbolCarre = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetString(u"seTUnitSymbolCarre") | |
if seTUnitSymbolCarre == "": seTUnitSymbolCarre = "2" | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetString(u"seTUnitSymbolCarre", seTUnitSymbolCarre) #*"2" | |
## | |
global switchQFileDialogMint # special LinuxMint | |
switchQFileDialogMint = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool("switchQFileDialogMint") | |
if switchQFileDialogMint == 0: | |
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool("switchQFileDialogMint", switchQFileDialogMint) | |
try: | |
if platform.node() == "mint": | |
switchQFileDialogMint = 1 | |
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool("switchQFileDialogMint", switchQFileDialogMint) #*Special Mint | |
except Exception: | |
None | |
## | |
global setPathLatestDirectory #; setPathLatestDirectory = "C:\ ???" | |
setPathLatestDirectory = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetString(u"setPathLatestDirectory") | |
if setPathLatestDirectory == "": setPathLatestDirectory = path | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetString(u"setPathLatestDirectory", setPathLatestDirectory) #*"C:\ ???" | |
## | |
global setBSplineToByArcValue #; setBSplineToByArcValue = 0.00001 | |
setBSplineToByArcValue = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetFloat(u"setBSplineToByArcValue") | |
if setBSplineToByArcValue == 0.0: setBSplineToByArcValue = 0.00001 | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetFloat(u"setBSplineToByArcValue", setBSplineToByArcValue) #*0.00001 | |
global BSplinetoByArcValeurS # string pour afficher en "0.00001" pas en 1.e5 | |
BSplinetoByArcValeurS = str("%.12f" % setBSplineToByArcValue) | |
BSplinetoByArcValeurS = str(BSplinetoByArcValeurS.rstrip('0')) | |
## | |
global setMeshTopologyValue #; setMeshTopologyValue = 0.1 | |
setMeshTopologyValue = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetFloat(u"setMeshTopologyValue") | |
if setMeshTopologyValue == 0.0: setMeshTopologyValue = 0.1 | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetFloat(u"setMeshTopologyValue", setMeshTopologyValue) #*0.1 | |
## | |
global switchBSplineCreateCircleConstructorAxis#; switchBSplineCreateCircleConstructorAxis = 0 # for create points with toByArcs() | |
switchBSplineCreateCircleConstructorAxis = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchBSplineCreateCircleConstructorAxis") | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool(u"switchBSplineCreateCircleConstructorAxis", switchBSplineCreateCircleConstructorAxis)#*True or False | |
## | |
global switchBSplineCreateCircleConstructor #; switchBSplineCreateCircleConstructor = 0 # for create circles with toByArcs() | |
switchBSplineCreateCircleConstructor = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchBSplineCreateCircleConstructor") | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool(u"switchBSplineCreateCircleConstructor", switchBSplineCreateCircleConstructor) #*True or False | |
## | |
global switchCreateLineDiVatNatOnClick #; switchCreateLineDiVatNatOnClick = 0 # for position line on click mouse | |
switchCreateLineDiVatNatOnClick = FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).GetBool(u"switchCreateLineDiVatNatOnClick") | |
FreeCAD.ParamGet(u"User parameter:BaseApp/Preferences/Macros/FCMmacros/" + __Title__).SetBool(u"switchCreateLineDiVatNatOnClick", switchCreateLineDiVatNatOnClick) #*True or False | |
## | |
#### Configuration end ################################################ | |
## | |
####tools after in FreeCAD.ParamGet########################################################### | |
## | |
global ui ; ui = "" # QtWidgets.QMainWindow() | |
global FCmw ; FCmw = "" # Docked RightDock LeftDock | |
global myNewFreeCADWidget; myNewFreeCADWidget = "" | |
## | |
####tools after in FreeCAD.ParamGet########################################################### | |
# | |
def App_Console_PrintMessage(textInfo): | |
global switchDisplayInfoObject | |
if switchDisplayInfoObject == 1 : | |
App.Console.PrintMessage(textInfo) | |
def errorDialog(msg): | |
global switchWarning | |
if switchWarning == 0: | |
None | |
else: | |
diag = QtWidgets.QMessageBox(QtWidgets.QMessageBox.Critical,"Error Message",msg ) | |
diag.setWindowFlags(PySide2.QtCore.Qt.WindowStaysOnTopHint) # PySide2 #cette fonction met la fenetre en avant | |
#diag.setWindowModality(QtCore.Qt.ApplicationModal) # la fonction a ete desactivee pour favoriser "WindowStaysOnTopHint" | |
diag.exec_() | |
global sel ; sel = u"" | |
global document_ ; document_ = u"FCInfo" | |
global object_Label ; object_Label = u"" | |
global object_Name ; object_Name = u"" | |
global typeObject ; typeObject = u"" # ShapeType : Compound | |
global object_Type ; object_Type = u"" # Part::Feature | |
global subElemName ; subElemName = u"" | |
global RotationToEuler; RotationToEuler = u"" | |
global position0 ; position0 = 0.0 | |
global position1 ; position1 = 0.0 | |
global position2 ; position2 = 0.0 | |
global diffuseColorRF ; diffuseColorRF = 0.0 # color face Red Float 0.0 a 1.0 | |
global diffuseColorVF ; diffuseColorVF = 0.0 # color face Vert/Green Float 0.0 a 1.0 | |
global diffuseColorBF ; diffuseColorBF = 0.0 # color face Blue Float 0.0 a 1.0 | |
global diffuseColorTF ; diffuseColorTF = 0.0 # color face Transparent Float 0.0 a 1.0 | |
global transparenceFace ; transparenceFace = 0 # taux de transparence de fa face 0 a 100 Int | |
global unsignedEncodeColor; unsignedEncodeColor = "" # resultat format 25144423565 unsigned FC | |
global cols ; cols = [] | |
global colorShapeFace ; colorShapeFace = [] | |
global colorShapeLine ; colorShapeLine = [] | |
global colorShapePoint ; colorShapePoint = [] | |
global colorShapeFaceDiffuseColor; colorShapeFaceDiffuseColor = [] | |
global longueurObjet ; longueurObjet = 0.0 | |
global rayonObjet ; rayonObjet = 0.0 | |
global perimetre ; perimetre = 0.0 | |
global numberEdges ; numberEdges = 0 | |
global typeLongueur ; typeLongueur = u"Length of object " | |
global nombreArretesMesh; nombreArretesMesh = 0 | |
global nombreFacesMesh ; nombreFacesMesh = 0 | |
global nombrePointsMesh ; nombrePointsMesh = 0 | |
global Plan_xy ; Plan_xy = 0.0 | |
global Plan_xy_V ; Plan_xy_V = u"" | |
global Plan_yz ; Plan_yz = 0.0 | |
global Plan_yz_V ; Plan_yz_V = u"" | |
global Plan_zx ; Plan_zx = 0.0 | |
global Plan_zx_V ; Plan_zx_V = u"" | |
global surface ; surface = 0.0 | |
global surfaceFace ; surfaceFace = 0.0 | |
global volume_ ; volume_ = 0.0 | |
global poids ; poids = 0.0 | |
global uniteM ; uniteM = 1.0 # unit of measurement length | |
global uniteMs ; uniteMs = u"mm" # micro hex="\xB5", html=<span>µ</span> | |
global uniteS ; uniteS = 1.0 # unit of measurement surface | |
global uniteSs ; uniteSs = u"mm"+seTUnitSymbolCarre # carre hex="\xb2", html=<span>²</span> | |
global uniteV ; uniteV = 1.0 # unit of measurement volume | |
global uniteVs ; uniteVs = u"mm"+seTUnitSymbolCube # cube hex="\xb3", html=<span>³</span> | |
global uniteP ; uniteP = 1.0 # unit of measure weight | |
global unitePs ; unitePs = u"g" | |
#global uniteAs ; uniteAs = " deg" #place plus haut | |
global boundBox_ ; boundBox_ = 0.0 | |
global boundBoxLX ; boundBoxLX = 0.0 | |
global boundBoxLY ; boundBoxLY = 0.0 | |
global boundBoxLZ ; boundBoxLZ = 0.0 | |
global boundBox_S ; boundBox_S = u"" | |
global BDvol ; BDvol = FreeCAD.Placement() | |
global switchBoundBoxCreateVolume ; switchBoundBoxCreateVolume = 0 # 1 = create Volume | |
global adaptWithBody ; adaptWithBody = 1 # 1 = adaptWithBody passe par adjustedGlobalPlacement() / 0 = mode normal | |
## Verify this section by person knowing the inertia position ## | |
## ONLY IF THE OBJECT IS PRESENT IN ONE BODY ## | |
## and post your knowledges in the forum tread if it is not correct ## | |
## http://forum.freecadweb.org/viewtopic.php?f=10&t=3185 ## | |
global boundBoxCenterX ; boundBoxCenterX = 0.0 | |
global boundBoxCenterY ; boundBoxCenterY = 0.0 | |
global boundBoxCenterZ ; boundBoxCenterZ = 0.0 | |
global boundBoxXMin ; boundBoxXMin = 0.0 | |
global boundBoxYMin ; boundBoxYMin = 0.0 | |
global boundBoxZMin ; boundBoxZMin = 0.0 | |
global boundBoxCenter; boundBoxCenter= 0.0 | |
global boundBoxDiag ; boundBoxDiag = 0.0 | |
global CenterOfMassX ; CenterOfMassX = 0.0 | |
global CenterOfMassY ; CenterOfMassY = 0.0 | |
global CenterOfMassZ ; CenterOfMassZ = 0.0 | |
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 | |
global MatrixX1_16 ; MatrixX1_16 = 0.0 | |
global MatrixY1_16 ; MatrixY1_16 = 0.0 | |
global MatrixZ1_16 ; MatrixZ1_16 = 0.0 | |
global MatrixX2_16 ; MatrixX2_16 = 0.0 | |
global MatrixY2_16 ; MatrixY2_16 = 0.0 | |
global MatrixZ2_16 ; MatrixZ2_16 = 0.0 | |
global MatrixX3_16 ; MatrixX3_16 = 0.0 | |
global MatrixY3_16 ; MatrixY3_16 = 0.0 | |
global MatrixZ3_16 ; MatrixZ3_16 = 0.0 | |
global MatrixX1_17 ; MatrixX1_17 = 0.0 | |
global MatrixY1_17 ; MatrixY1_17 = 0.0 | |
global MatrixZ1_17 ; MatrixZ1_17 = 0.0 | |
global MatrixX2_17 ; MatrixX2_17 = 0.0 | |
global MatrixY2_17 ; MatrixY2_17 = 0.0 | |
global MatrixZ2_17 ; MatrixZ2_17 = 0.0 | |
global MatrixX3_17 ; MatrixX3_17 = 0.0 | |
global MatrixY3_17 ; MatrixY3_17 = 0.0 | |
global MatrixZ3_17 ; MatrixZ3_17 = 0.0 | |
global DeterminantM ; DeterminantM = 0.0 | |
global refreshMatrix ; refreshMatrix = 1 | |
global Vertx ; Vertx = u"" | |
global Edges ; Edges = u"" | |
global ReperEdge ; ReperEdge = 0 | |
global EdgesLong ; EdgesLong = 0.0 | |
global Faces ; Faces = u"" | |
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 | |
global placement_ ; placement_ = u"" | |
global RowCount ; RowCount = 200 | |
global RowCountTest ; RowCountTest = 0 | |
global SaveName ; SaveName = u"" | |
global ESCAPE ; ESCAPE = u"\t" # tabulation SpreadSheet separation | |
global angleX1 ; angleX1 = 0.0 | |
global angleY1 ; angleY1 = 0.0 | |
global angleZ1 ; angleZ1 = 0.0 | |
global angleX2 ; angleX2 = 0.0 | |
global angleY2 ; angleY2 = 0.0 | |
global angleZ2 ; angleZ2 = 0.0 | |
global directionObj ; directionObj = "[]" | |
global direcValueAt ; direcValueAt = "[]" | |
global direcNormalAt ; direcNormalAt = "[]" | |
global typeNormalAt ; | |
if switchCreateLineDiVatNatOnClick == 0: | |
typeNormalAt = u"NormalAt(0,0)" | |
else: | |
typeNormalAt = u"*NormalAt(0,0)" | |
global switchInertia ; switchInertia = 0 # 0 = pass / 1 = stop for create plane without refresh | |
global BsplineDetect ; BsplineDetect = u"" | |
global BsplinePointsCoor ; BsplinePointsCoor = [] | |
global BsplineNombreDeNoeuds ; BsplineNombreDeNoeuds = 0 | |
global BsplineArcsRadius ; BsplineArcsRadius = [] | |
global BsplineArcsLocation ; BsplineArcsLocation = [] | |
global BsplineRayonApproximatif; BsplineRayonApproximatif = u"" | |
global BsplineCercleToolTip ; BsplineCercleToolTip = u"Bspline détecté " | |
global BsplineNumberElement ; BsplineNumberElement = 0 | |
global BsplineCutLength ; BsplineCutLength = 0.0 | |
global detected ; detected = u"" | |
################################################################################## | |
Macro_FCInfo_01 = [ | |
" 24 24 8 1", | |
"` c #a90d0e", | |
". c #a39697", | |
"# c #875e5e", | |
" c None", | |
"b c #e10c0d", | |
"c c #ed5f60", | |
"d c #e1a1a1", | |
"e c #8d3130", | |
" ", | |
" d.ccccdd ", | |
" .ebbccccce#d ", | |
" #bbbcd dcbb`. ", | |
" ebbbbc cbbbb# ", | |
" #bbbbbd ccbbbb. ", | |
" .bbbccbd cddcbbe ", | |
" ebbc cc d dbbb# ", | |
" d`bbd cc cd cbbe ", | |
" .bbbd dbc cc dbb`d ", | |
" cbbc cbc bbd dbbbd ", | |
" ebbc cbbd cbbd dbbbd ", | |
" ebbc cbbbccbbbd dbbbd ", | |
" #bbbd dbbbbbbbbd cbb`d ", | |
" .bbbd cbbbbbbd cbb` ", | |
" d`bbc dcbbbbd dbbb# ", | |
" #bbbc dddd dcbb`. ", | |
" d`bbbcd ddcbbb# ", | |
" .`b`bbcddddcbbbbed ", | |
" #`b```bbbb``bbe. ", | |
" .ebbbbbbbbb`#d ", | |
" d#e`````e#. ", | |
" ddddd ", | |
" "] | |
Macro_FCInfo_02 = [ | |
" 24 23 8 1", | |
"` c #4478b4", | |
". c #a4c0de", | |
"# c #7b9ac1", | |
" c None", | |
"b c #c8d0db", | |
"c c #6391c5", | |
"d c #89aad1", | |
"e c #5b80ad", | |
" bdd##ddb ", | |
" ddbbbbb.d#d b# ", | |
" d.bbbbb...b.#. bcd ", | |
" ..b..dd.bb....dc#.d ", | |
" #bc``dbbd#..ddddddd ", | |
" #e`` dcdd###dd ", | |
" .ecd# ddd##dd ", | |
" b`b.. ddd##dd ", | |
" bd bdddddd. ", | |
" b b`#c###c. ", | |
" cd###ded b ", | |
" .b...bd d ", | |
" d.d..c b# ", | |
" d....c b #c ", | |
" d.dd..cdb . d`. ", | |
" d...d###ee##ce#ee` ", | |
" ...cddccc###cceecce ", | |
" d.#b#cd#ccccccccceb ", | |
" #ebbb.ec##cccccce. ", | |
" bb bbbb.#eeeeee#b b ", | |
" bbbbbbbbb.bb b ", | |
" bbbbb ", | |
" "] | |
Macro_FCInfo_03 = [ | |
" 24 24 8 1", | |
"` c #293444", | |
". c #619ee5", | |
"# c #366ab3", | |
"a c #6f7885", | |
"b c #b7b8b8", | |
"c c #ecedec", | |
"d c #344861", | |
"e c #919aa2", | |
"bccbccbcbbaaecccbccbcbcc", | |
"ecbebbebd#aaaddcbcbebeec", | |
"bcbbbbbd.#.b..aabcbbbbbc", | |
"ebcacbda.a#a...adbbaceec", | |
"ccccce`abce#a..e#bcccccc", | |
"bccbcaacbcced...#ecbcbcc", | |
"aaadaaaadaad`a.#.ddaaecc", | |
"aabbbbeaaaaa`#.#.ddadacc", | |
"aecbbcbaa``#d.##..#d`acc", | |
"beccccb`ead..#####.adbcc", | |
"e```````da#d#ddd`d#`dacc", | |
"aacbbbedabbd##``##deeacc", | |
"aacebbedabba`##d#dabbacc", | |
"aebebbedabbee`#.dabeeabc", | |
"b`ddddd``````d`````d`ecc", | |
"aaeaeea`deeabaadaeeaaacc", | |
"aabbbcedebbecbbbeeebeacc", | |
"aabeebedeebebbbeeeeeeabc", | |
"e````d````d`d`d``````abc", | |
"baeeeea`aeeeeeeeeeeeaecc", | |
"aecbcbbdacbecbbcebbbbacc", | |
"aacbccedacbbbbbbbbcbbacc", | |
"aaaaaaaddaaaaaaaaaaaaabc", | |
"bccbccbcbccbccccbccbcbbc"] | |
Macro_FCInfo_04 = [ | |
" 24 24 8 1", | |
"` c #2e383f", | |
". c #7a9abf", | |
"# c #4870a2", | |
"a c #7a8592", | |
" c None", | |
"c c #adb0b1", | |
"d c #425264", | |
"e c #5b89c3", | |
" ca ", | |
" .dacc ", | |
" cad.c . ", | |
" adac ca` ", | |
" cd`c cddacc ", | |
" adacdc caddac . ", | |
" ccac adddac cadc ", | |
" caac cad`a .ddaca ", | |
" caadddac#. cadd. c ", | |
" caada .`ddac cada ", | |
" .aa#a cad`a c.ddac. ", | |
" c#dd`d`d.ddcca``#.c cc", | |
" cd#.....e..eee...aaac ", | |
" .de.eeee.e.eeeee... ", | |
" ad..eeeeeeeeeeeeeec ", | |
" .d......e.....eeeec ", | |
" ad............eeeec ", | |
" ad.....eeeeeeeeeeec ", | |
" #deeeee#########ee. ", | |
" #d################. ", | |
" dd##############e#c ", | |
" #deeeeeeeeeeeeeeedc ", | |
" d`ddddddddddddddd#c ", | |
" aaaaaaaaaaaaaaaaaac "] | |
Macro_FCInfo_05 = [ | |
" 24 24 8 1", | |
"` c None", | |
". c #280000", | |
"# c #8ae234", | |
"a c #729fcf", | |
"b c #2a1018", | |
"c c #c8a9a7", | |
"d c #ef2929", | |
"e c #000000", | |
" . ", | |
" ... ", | |
" .#. ", | |
" ... .#. ", | |
" .aa. ..#.. ", | |
" .aaa... .###. ", | |
" .aaaa.. .###. ", | |
" .aaaa. ..#.. ", | |
" .aaaa. .#. ", | |
" ..aaaa. .#. ", | |
" ...aaa. .#. ", | |
" .aab....#...", | |
" .bacccc#ccc", | |
" .acccc#ccc", | |
" .caccc#ccc", | |
" .ccacc#ccc", | |
" .ccacc#ccc", | |
" .cccac#ccc", | |
" .... .cccca#ccc", | |
" ....dd........cccca#ccc", | |
"..ddddddddddddddddddaddd", | |
" ....dd........ccccc#acc", | |
" .... .ccccc#acc", | |
" .ccccc#cac"] | |
Macro_FCInfo_06 = [ | |
" 24 24 8 1", | |
"` c #2c0204", | |
". c #749ecc", | |
"# c #ccaaa4", | |
"a c #0dfa0d", | |
"b c #8ce234", | |
"c c #ec2a2c", | |
" c None", | |
"e c #fcfefc", | |
" ` ", | |
" `````` ``` ", | |
" ```aaaa``` `b` ", | |
" ```aaaaaaaa``` `b` ", | |
" `aaaaaaaaaaaa` ``b`` ", | |
" ``aaaaaaaaaaaa```bbb` ", | |
" `aaaaaaaaaaaaea``bbb` ", | |
" ``aaaaaaaaaaaeea```b`` ", | |
" `aaaaaaaaaaaeeeaa``b` ", | |
" `aaaeeaaaaaeeeeaa``b` ", | |
" `aaaeeeaaaeeeeaaa``b` ", | |
" `aaaeeeeaeeeeaaaa``b```", | |
" ``aaaeeeeeeeaaaa``#b###", | |
" `aaaaeeeeeaaaaa`##b###", | |
" ``aaaaeeeaaaaa``##b###", | |
" `aaaaaeaaaaaa`.##b###", | |
" ```aaaaaaaa```.##b###", | |
" ```aaaa```###.#b###", | |
" ````````` `####.b###", | |
" ````cc````````####.b###", | |
"``cccccccccccccccccc.ccc", | |
" ````cc````````#####b.##", | |
" ```` `#####b.##", | |
" `#####b#.#"] | |
Macro_FCInfo_07 = [ | |
" 24 24 8 1", | |
" c None", | |
". c #280000", | |
"# c #ef2929", | |
"a c #8ae234", | |
"b c #ffffff", | |
"c c #c8a9a7", | |
"d c #729fcf", | |
"e c #000000", | |
" . ", | |
" ......... ... ", | |
" ..#######.. .a. ", | |
" ..#########.. .a. ", | |
" ..###########.. ..a.. ", | |
" ..##bb#####bb##...aaa. ", | |
" .###bbb###bbb###..aaa. ", | |
" .####bbb#bbb####...a.. ", | |
" .#####bbbbb#####. .a. ", | |
" .######bbb######. .a. ", | |
" .#####bbbbb#####. .a. ", | |
" .####bbb#bbb####...a...", | |
" .###bbb###bbb###.ccaccc", | |
" ..##bb#####bb##..ccaccc", | |
" ..###########..cccaccc", | |
" ..#########..cdccaccc", | |
" ..#######..ccdccaccc", | |
" ..........cccdcaccc", | |
" .... .ccccdaccc", | |
" ....##........ccccdaccc", | |
"..##################d###", | |
" ....##........cccccadcc", | |
" .... .cccccadcc", | |
" .cccccacdc"] | |
Macro_FCInfo_08 = [ | |
"21 24 8 1", | |
"` c #fc0507", | |
". c #fc9494", | |
"# c #fc4c4b", | |
"a c #fcd1d0", | |
" c None", | |
"c c #fcb9b9", | |
"d c #fc3433", | |
"e c #fc6f6f", | |
" a````e.a ", | |
" c```dd````d.aa ", | |
" e`dd` a.#````d", | |
" d`# e` c```", | |
" a``e e` c```", | |
" .``a e` a`d``", | |
"e``e e` a`` #`", | |
"``````e.#` a`` d`", | |
"`da.ed`````#.a#`a #`", | |
"`# ad`d````c #`", | |
"`# e` a`d #`", | |
"`# e` d` #`", | |
"`# e`c d` #`", | |
"`# e``````` #`", | |
"`# #`#ac#````#c #`", | |
"`# ``e d`d`````", | |
"`# a``c d` ce``", | |
"`#c``a d` a``", | |
"```d d` a`` ", | |
"```c d` a`` ", | |
"c````ea dda`` ", | |
" ce````dc #```a ", | |
" a.d```d.d``a ", | |
" .`````a "] | |
Macro_FCInfo_09 = [ | |
" 24 24 8 1", | |
"` c #b7201c", | |
". c #cba938", | |
"# c #e1cb42", | |
"a c #d6d1bd", | |
"b c #f4e256", | |
"c c #b7752b", | |
"d c #c7b295", | |
" c None", | |
" dda ", | |
" a.c.a ", | |
" dcdcd ", | |
" a.cc. ", | |
" dccca ", | |
" a.ccc a ", | |
" accc## ", | |
" d.bbbca ", | |
" b#bbac`` ", | |
" a#.c`c`.a ", | |
" d```cbbb. ", | |
" d``.bbbb## ", | |
" d#bbbb####a ", | |
" #bbbb####b# ", | |
" ##bbb###.#ab ", | |
" .b#####.####ab ", | |
" a##########.ba ", | |
" a#.#####.####a ", | |
" aaadb.###.b.#daaa ", | |
" a aaa#.#.#b..ddaaaa ", | |
" aaaddb###ddddaaaa ", | |
" aaadadadaaaaa ", | |
" a aa a a ", | |
" "] | |
Macro_FCInfo_10 = [ | |
" 24 24 8 1", | |
"` c #486ea4", | |
". c #b8babd", | |
"# c #868e98", | |
"a c #dfdfe1", | |
"b c #9da5b1", | |
"c c #6687b4", | |
"d c #d0d2d2", | |
" c None", | |
" aaa ", | |
" .bcc#bb ", | |
" .cbbbbbcc ", | |
" accccbbbbcb ", | |
" cc.adccbcbca ", | |
" aca cbcbcb ", | |
" d.b####ccccb`####. ", | |
" aa.a...bcccb`b....a ", | |
" dda#ccbbcccbbc`d.d ", | |
" #aaacccccc``cc.aa# ", | |
" d.aa dcc````cc.aaabd ", | |
" #a aaad`c``c`bddadd# ", | |
" ab daada.`c`ccdddaaa#a ", | |
" .aaaaadddbccc.ddddddd. ", | |
" .aadadaaddb`..dddddddb ", | |
"a.a adaddadaddadddda d.a", | |
"a.aaaaaaadadadadadadddba", | |
"a.d...........b.b.bbb.#a", | |
"a...##bbb.bbbb.b..bb.b#a", | |
"a...##bbbb.b.b.bb.bb.b#a", | |
"a.....bb.bb.bb.bb.bb.b#a", | |
"abddddd.d........bbbbb#a", | |
" .b###################. ", | |
" addddddaddddddddaaa "] | |
Macro_FCInfo_11 = [ | |
" 24 24 8 1", | |
"` c #040204", | |
". c #749ecc", | |
"# c #ec2a2c", | |
"a c #244a84", | |
"b c #fcea4c", | |
" c None", | |
"d c #040234", | |
"e c #040644", | |
" ", | |
" ", | |
" ```````` ", | |
" ```.....```````` ", | |
" ```...........```` ", | |
" ````````.....de`aa` ", | |
" `.....````````aaaa` ", | |
" `............`aaaa` ", | |
" `....bbb.....`aaaa` ", | |
" `...bbbbb....`aaaa` ", | |
" `...b``bb....`aaa`` ", | |
" ``...```bb...``aaa`` ", | |
" ``..``#`b....``aaa` ", | |
" `..``##`.....`aaaa` ", | |
" `.``###`.....`aaaa` ", | |
" ```####`.....`aaaa` ", | |
" ``#####`.....`aaaa` ", | |
" ``######`.....`aaa`` ", | |
" ```#####`.....`a``` ", | |
" `#####````..``` ", | |
" `###`#` ````` ", | |
" `##```` ", | |
" ```` ", | |
" "] | |
Macro_FCInfo_12 = [ | |
" 24 24 8 1", | |
"` c #060407", | |
". c #049a9c", | |
"# c #c5a107", | |
"a c #ec2a2c", | |
" c None", | |
"c c #34e2e4", | |
"d c #342a34", | |
"e c #fcae3c", | |
" `ccccccccccc`...` ", | |
" `cccccccccccc`...` ", | |
" `ccccccccccc`.....` ", | |
" ````cccccccc`.....` ", | |
" `###````ccc`.....` ", | |
" `#######```......` ", | |
" `###`#####`.....` ", | |
" `#`a`####`.....` ", | |
" ``aaa`####`...` ", | |
" `aaaa`#````````d``d```", | |
" `aaa`##`eeeeeeeeeeeee`", | |
" `aaa``#``eeeeeeeeeeee`", | |
" `aaa` ``a`eeeeeeeeeee`", | |
" `aaa` `aa`eeeeeeeeee`", | |
" `aaaa` `aaa`eeeeeeeee`", | |
" `aaaa`aaaaa`eeeeeeee`", | |
" `aaaaaaaaaa`eeeeeee`", | |
" `aaaaaaaaa`eeeeeee`", | |
" ``aaaaaa`eeeeeeee`", | |
" `aaaa`eeeeeeeee`", | |
" `aa`eeeeeeeeee`", | |
" `a`eeeeeeeeeee`", | |
" ``eeeeeeeeeeee`", | |
" ```````````````"] | |
Macro_FCInfo_13J = [ | |
"24 24 4 1", | |
" c None", | |
". c #280000", | |
"+ c #EF2929", | |
"@ c #FBE852", | |
"... ", | |
".++... ++ ", | |
".+++++.. ++++ ", | |
" .+++++.. +++ + ", | |
" .++@@. +++ + ", | |
" .++@@@. ++ + + ", | |
" .+.@@@. + + ", | |
" .. .@@@. +++ + ", | |
" . .@@@. + ", | |
" .@@@. + ++ ", | |
" .@@@. + ++++ ", | |
" .@@@. ++ + ", | |
" .@@@. + ", | |
" .@@@. ", | |
" .@@@. ", | |
" .@@@. ", | |
" .@@@. ", | |
" .@@@. ", | |
" .@@@. ", | |
" .@@@. ", | |
" .@@@. ", | |
" .@@@.", | |
" .@++", | |
" .++"] | |
Macro_FCInfo_13M = [ | |
"24 24 5 1", | |
" c None", | |
". c #280000", | |
"+ c #EE292B", | |
"@ c #EF2929", | |
"# c #FE19FF", | |
"... ", | |
".@@... ++ ", | |
".@@@@@.. ++ ", | |
" .@@@@@.. ++ ", | |
" .@@##. ++ ", | |
" .@@###. ++ +++ ", | |
" .@.###. ++++++ ", | |
" .. .###. ++ +++ ", | |
" . .###. ++++++ ", | |
" .###. ++ + + +", | |
" .###. +++ ++", | |
" .###. + ++ ", | |
" .###. + ++ ", | |
" .###. ++ ", | |
" .###. + ", | |
" .###. + ", | |
" .###. ", | |
" .###. ", | |
" .###. ", | |
" .###. ", | |
" .###. ", | |
" .###.", | |
" .#@@", | |
" .@@" | |
] | |
Macro_FCInfo_13C = [ | |
"24 24 5 1", | |
" c None", | |
". c #280000", | |
"+ c #EE292B", | |
"@ c #EF2929", | |
"# c #19FEFF", | |
"... ", | |
".@@... ++ ", | |
".@@@@@.. +++ ", | |
" .@@@@@.. +++ ", | |
" .@@##. ++ + ++ ", | |
" .@@###. + +++ + ", | |
" .@.###. ++ +++ ", | |
" .. .###. ++ ++ ++ ", | |
" . .###. ++ ++ ", | |
" .###. ++ ++ ++ ", | |
" .###. +++ ++++", | |
" .###. + ++ +", | |
" .###. ++ + +", | |
" .###. + +++", | |
" .###. + ", | |
" .###. + ", | |
" .###. ", | |
" .###. ", | |
" .###. ", | |
" .###. ", | |
" .###. ", | |
" .###.", | |
" .#@@", | |
" .@@" | |
] | |
Macro_FCInfo_Point = [ | |
"24 24 8 1", | |
" c None", | |
". c #000100", | |
"+ c #B0A22C", | |
"@ c #E9D235", | |
"# c #6B6014", | |
"$ c #F7E66C", | |
"% c #FBF4BC", | |
"& c #D5B716", | |
" ", | |
" ", | |
" ", | |
" ", | |
" ...... ", | |
" ..+@@@@+.. ", | |
" .#$$$@@@@@#. ", | |
" .#$%%$@@@@@@#. ", | |
" .$%%%$@@@@@@@. ", | |
" .+$%%$@@@@@@@@+. ", | |
" .@$$$@@@@@&&&&&. ", | |
" .@@@@@@@&&&&&&&. ", | |
" .@@@@@&&&&&&&&&. ", | |
" .@@@@&&&&&&&&&&. ", | |
" .+@@&&&&&&&&&&+. ", | |
" .@&&&&&&&&&&&. ", | |
" .#&&&&&&&&&&#. ", | |
" .#&&&&&&&&#. ", | |
" ..+&&&&+.. ", | |
" ...... ", | |
" ", | |
" ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_Plane = [ | |
"24 24 8 1", | |
" c None", | |
". c #A40000", | |
"+ c #204A87", | |
"@ c #208020", | |
"# c #EF2929", | |
"$ c #729FCF", | |
"% c #8AE234", | |
"& c #729ECE", | |
" . ", | |
" .. + @ ", | |
" .#. +$+ @@ ", | |
" .##.+$$$+ @%@ ", | |
" .###.$$$$@%%@ ", | |
" .####.$$@%%%@ ", | |
" ..####.@%%%%@ ", | |
" ++.##.@.%%%@+ ", | |
" +&$+..@@#.%@+$+ ", | |
" +&$&&+@%@##.+$$$+ ", | |
" +&$&&&@%%@###.$$$$+ ", | |
" +&$&&&@%%%@####.$$$$+ ", | |
" +$&&@%%%%@#####.$$$$+ ", | |
" +$&@%%%@+.#####.$$$+ ", | |
" +&@%%@+$+.####.$$+ ", | |
" +@%@+$$$+.###.$+ ", | |
" @@+$$$$$+.##.+ ", | |
" @+$$$$$$$+.#. ", | |
" @%+$$$$$$$+.. ", | |
" @%%+$$$$$$+#. ", | |
" @%@ +$&$$+##. ", | |
" @@ +$$+ .#. ", | |
" @ ++ .. ", | |
" . " | |
] | |
Macro_FCInfo_Axis = [ | |
"24 24 6 1", | |
" c None", | |
". c #204B86", | |
"+ c #247F23", | |
"@ c #A30701", | |
"# c #204A87", | |
"$ c #208023", | |
" ", | |
" ", | |
" .. ", | |
" .. ", | |
" .. ", | |
" . ", | |
" . ", | |
" ++ .. ", | |
" +++ .. @ ", | |
" +++ .. @@@@ ", | |
" +++ .# @@@@ ", | |
" +$#@@@@ ", | |
" @@@@##@ ", | |
" @@@@@ ..+++ ", | |
" @@ .. +++ ", | |
" .. +++ ", | |
" .. ++ ", | |
" .. ", | |
" . ", | |
" . ", | |
" .. ", | |
" .. ", | |
" .. ", | |
" " | |
] | |
Macro_FCInfo_Info = [ | |
"24 24 10 1", | |
" c None", | |
". c #F57900", | |
"+ c #BCBCB3", | |
"@ c #555755", | |
"# c #ECEEEB", | |
"$ c #D8DAD7", | |
"% c #DBDDDA", | |
"& c #E6E9E5", | |
"* c #F2F4F1", | |
"= c #EFF1EE", | |
" ", | |
" ", | |
" . . . . ", | |
" +..+..+..+..++ ", | |
" @@..@..@..@..@+ ", | |
" @#.##.##.##.#@+ ", | |
" @############@+ ", | |
" @#$$$$$$$$$$#@+ ", | |
" @#++++++++++#@+ ", | |
" @#$%%%%%$$$##@+ ", | |
" @#++++++++++#@+ ", | |
" @#$%%%$$$$%#&@+ ", | |
" @#++++++++%##@+ ", | |
" @#$%$$$$$$$%#@+ ", | |
" @#+++++++++%#@+ ", | |
" @#$$$$$$$$$$*@+ ", | |
" @#++++$######@+ ", | |
" @#$$$$$####@@@+ ", | |
" @####&=*##@@@++ ", | |
" @###&#***#@@++ ", | |
" @@@@@@@@@@@++ ", | |
" +++++++++++ ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_Radian = [ | |
"24 24 6 1", | |
" c None", | |
". c #0C0000", | |
"+ c #171018", | |
"@ c #EE2C29", | |
"# c #749FCE", | |
"$ c #FFFFFF", | |
" ", | |
" ", | |
" ....... +++ ", | |
" ...#####... + + ", | |
" ..#########@@ ++ ", | |
" ..##########$@@ + + ", | |
" ..##########$##@@ ", | |
" .##########$####@ ", | |
" ..##########$####@@ ", | |
" .##########$######@ ", | |
" .#########$#######@ ", | |
" .########$$$$$$$$$$ ", | |
" .#################. ", | |
" .##########+++####. ", | |
" ..#########+#+###.. ", | |
" .#########++####. ", | |
" ..########+#+##.. ", | |
" ..###########.. ", | |
" ..#########.. ", | |
" ...#####... ", | |
" ....... ", | |
" ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_Pourcent = [ | |
"24 24 4 1", | |
" c None", | |
". c #000000", | |
"+ c #A40000", | |
"@ c #FFFFFF", | |
" ", | |
" ", | |
" ", | |
" ", | |
" + ", | |
" +++ ", | |
" +@+ ", | |
" ++@++ ", | |
" ++@@@++ ", | |
" +@@@@@+ ", | |
" ++@.@.@++ ", | |
" ++@@.@..@++ ", | |
" +@@@.@@.@@+ ", | |
" ++@.@@@@@@@++ ", | |
" ++@....@@@@@@++ ", | |
" +@.......@@@@@+ ", | |
" ++@.........@@@++ ", | |
" ++@............@@++ ", | |
" +@...............@+ ", | |
" ++@@@@@@@@@@@@@@@@@++ ", | |
" +++++++++++++++++++++ ", | |
" ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_Degrees = [ | |
"24 24 5 1", | |
" c None", | |
". c #000000", | |
"+ c #EE2C29", | |
"@ c #3965A3", | |
"# c #FFFFFF", | |
" ", | |
" ", | |
" ", | |
" ..", | |
" . ... ..", | |
" . . . . ", | |
" ... . . ", | |
" . . . ", | |
" #+ . ... ", | |
" ##++ ", | |
" ##@@++ ", | |
" ##@@@@+ ", | |
" ##@@@@@++ ", | |
" ###@@@@@@@++ ", | |
" ###@@@@@@@@@++ ", | |
" ##@@@@@@@@@@@@+ ", | |
" ##@@@@@@@@@@@@@++ ", | |
" ##@@@@@@@@@@@@@@@+ ", | |
" ##@@@@@@@@@@@@@@@@+ ", | |
" ################### ", | |
" ", | |
" ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_DegreesMinSec = [ | |
"24 24 6 1", | |
" c None", | |
". c #000000", | |
"+ c #A40000", | |
"@ c #204A87", | |
"# c #4E9A06", | |
"$ c #FCAF3E", | |
" ", | |
" ", | |
" +++++++ ", | |
" +++$@$@$+++ ", | |
" ++$$$@.@$$$++ ", | |
" ++$@$$$$$$.@$++ ", | |
" ++$.$@$$$$$$$$$++ ", | |
" +$@..$$$$$$$$$$$+ ", | |
" ++$$@..$$$$$.$$.@++ ", | |
" +$$$$$..$$$..$$$$$+ ", | |
" +$$$$$$..$..$$$$$$+ ", | |
" +@@.$$$$...$$$$.@@+ ", | |
" +$$$$$$$$.$$$$$$$$+ ", | |
" +$$$$$$$$$$$$$$$$$+ ", | |
" ++$$.$$$###$$$$.$++ ", | |
" +$@$$$$$#$$$$$$@+ ", | |
" ++$$$$$$$$$.$$$++ ", | |
" ++$$.$$$$$$@$++ ", | |
" ++@$$$.$$$$++ ", | |
" +++$$@$$+++ ", | |
" +++++++ ", | |
" ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_Grade = [ | |
"24 24 5 1", | |
" c None", | |
". c #000000", | |
"+ c #A40000", | |
"@ c #C4A000", | |
"# c #FFFFFF", | |
" ", | |
" ", | |
" # # ", | |
" #...#... # ", | |
" #+++#++..#. ", | |
" #@@@@@@+#+... # ", | |
" #@@@@@@@@@++..# ", | |
" #@@#@@@@@@@@+#. ", | |
" #@@#@@@#@@@@@+.. ", | |
" #@@#@@#@@@@@@@+.. ", | |
" #@@#@@#@@@#@@@@+..# ", | |
" #@#@@#@@@#@@@@@@+# ", | |
" #@#@@#@@#@@@@@@@#. ", | |
" #@#@#@@#@@@@@#@@+.. ", | |
" #@#@#@#@@@@##@@@@+. ", | |
" #@##@#@@@##@@@@@@+. ", | |
" #@###@@##@@@@@@@@+. ", | |
" ####@##@@@@@@@@@@#### ", | |
" #####@@@@######@@+. ", | |
" #########@@@@@@@@+. ", | |
" +#################### ", | |
" ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_ClipBoard_None = [ | |
"24 24 9 1", | |
" c None", | |
". c #A30500", | |
"+ c #555755", | |
"@ c #BCBCB3", | |
"# c #D7DAD6", | |
"$ c #DBDDDA", | |
"% c #E7E9E6", | |
"& c #EBEEEA", | |
"* c #F1F4F0", | |
" ", | |
" @...@@@@@@@@@@@ ... ", | |
" ++....+++++++++@.... ", | |
" +$....$$$$$$$$+..... ", | |
" +$$....$$$$$$$..... ", | |
" +$$.....$$$$......@@@ ", | |
" +$$@....+++......+++@ ", | |
" +$$$$....&......&&&+@ ", | |
" +$$@@.........&&&&&+@ ", | |
" +$$$$$.......&&&&&&+@ ", | |
" +$$@@@+.....@@@@@@&+@ ", | |
" +$$$$$......$$###&&+@ ", | |
" +$$@@........@@@@@&+@ ", | |
" +$$..........###$&%+@ ", | |
" +$......&@....@@$&&+@ ", | |
" +......&&$.....##$&+@ ", | |
" .....$+&&@@....@@$&+@ ", | |
" .....$$+&&&&&....&&*+@ ", | |
" ....++++&&&&&.....&&+@ ", | |
" ... +&&&&&&....+++@ ", | |
" +&&&&%**....+@@ ", | |
" +&&&%&**....@@ ", | |
" +++++++++...@ ", | |
" @@@@@@@@@@@ " | |
] | |
Macro_FCInfo_ClipBoard_FC = [ | |
"24 24 9 1", | |
" c None", | |
". c #A30500", | |
"+ c #154A89", | |
"@ c #555755", | |
"# c #BCBCB3", | |
"$ c #DADDDA", | |
"% c #E7E9E6", | |
"& c #EBEEEA", | |
"* c #F1F4F0", | |
" ", | |
" ############### ", | |
" @@@@@@@@@@@@@@@# ", | |
" @$$$$$$$$$$$$$@# ", | |
" @$$$$$$$$$$$$$@# ", | |
" @$$$$$$$$$$$$$@###### ", | |
" @$$###@@@@@@@@@@+@@@# ", | |
" @$$$.......+&&&++&&@# ", | |
" @$$#.......++&++&&&@# ", | |
" @$$$.......++++&&&&@# ", | |
" @$$#...&+++++++###&@# ", | |
" @$$$.....+$%$++++&&@# ", | |
" @$$#......%%%+++++&@# ", | |
" @$$$.....+$%$++++&%@# ", | |
" @$$$...&+++++++#$&&@# ", | |
" @$$$...++$+++$++$$&@# ", | |
" @$$$..++&#+++##++$&@# ", | |
" @$$$..+&&&&+&&&&+&*@# ", | |
" @@@@@@@&&&&&&&&&&&&@# ", | |
" @&&&&&&&&&&@@@# ", | |
" @&&&&%**&&@@@## ", | |
" @&&&%&***&@@## ", | |
" @@@@@@@@@@@## ", | |
" ########### " | |
] | |
Macro_FCInfo_ClipBoard_Comma = [ | |
"24 24 9 1", | |
" c None", | |
". c #000000", | |
"+ c #A30500", | |
"@ c #2C4A85", | |
"# c #555755", | |
"$ c #52990C", | |
"% c #BCBCB3", | |
"& c #DADDD9", | |
"* c #ECEEEB", | |
" ", | |
" %%%%%%%%%%%%%%% ", | |
" ###############% ", | |
" #&&&&&&&&&&&&&#% ", | |
" #&&&&&&&&&&&&&#% ", | |
" #&&&&&&&&&&&&&#%%%%%% ", | |
" #&&%%%##############% ", | |
" ++&&&&++*$$**$$*@@@@@@ ", | |
" +++&%+++*$$$&$$&@@@@@@ ", | |
" ++&&++#**$$*$$****@@% ", | |
" #++++%#**$$%$$%%%%@@% ", | |
" #&++&&#**&$$$$&&&@@#% ", | |
" #&++%%#**%$$$$%%%@@#% ", | |
" #++++&#**&&$$&&&&@@#% ", | |
" ++&&++#**%%$$%%%@@*#% ", | |
" +&&&&+#**&$$$&&&@@*#% ", | |
" ++&&&&++..%$$..%@@@@@@ ", | |
" +#&&&&&+..*$$..*@@@@@@ ", | |
" #######*.****.*****#% ", | |
" #..***..***###% ", | |
" ..***..***###%% ", | |
" #*********##%% ", | |
" ###########%% ", | |
" %%%%%%%%%%% " | |
] | |
Macro_FCInfo_ClipBoard_Raw = [ | |
"24 24 9 1", | |
" c None", | |
". c #000000", | |
"+ c #A30500", | |
"@ c #2C4A85", | |
"# c #555755", | |
"$ c #52990C", | |
"% c #BCBCB3", | |
"& c #DADDD9", | |
"* c #ECEEEB", | |
" ", | |
" %%%%%%%%%%%%%%% ", | |
" ###############% ", | |
" #&&&&&&&&&&&&&#% ", | |
" #&&&&&&&&&&&&&#% ", | |
" #&&&&&&&&&&&&&#%%%%%% ", | |
" #&&%%%##############% ", | |
" ++&&&&++*$$**$$*@@@@@@ ", | |
" +++&%+++*$$$&$$&@@@@@@ ", | |
" ++&&++#**$$*$$****@@% ", | |
" #++++%#**$$%$$%%%%@@% ", | |
" #&++&&#**&$$$$&&&@@#% ", | |
" #&++%%#**%$$$$%%%@@#% ", | |
" #++++&#**&&$$&&&&@@#% ", | |
" ++&&++#**%%$$%%%@@*#% ", | |
" +&&&&+#**&$$$&&&@@*#% ", | |
" ++&&&&++**%$$%%%@@@@@@ ", | |
" +#&&&&&+***$$***@@@@@@ ", | |
" #######************#% ", | |
" #**********###% ", | |
" #*********###%% ", | |
" #*********##%% ", | |
" ###########%% ", | |
" %%%%%%%%%%% " | |
] | |
Macro_FCInfo_BoundBoxTracing = [ | |
"24 24 8 1", | |
" c None", | |
". c #A30500", | |
"+ c #ED2928", | |
"@ c #69678E", | |
"# c #6B6990", | |
"$ c #6D6B92", | |
"% c #706E95", | |
"& c #746F91", | |
" ", | |
" ", | |
" +++. ", | |
" ++++..++. ", | |
" ++++.... ++. ", | |
" +++.... +.+. ", | |
" ++. +.+. ", | |
" +.+. +++. +. ", | |
" +. +. ++++..+. +. ", | |
" +. ++++... +. +. ", | |
" +. +.. +++. +. ", | |
" +. +. ++++...+.+. ", | |
" +. ++++.... ++. ", | |
" +++.+.. +. ", | |
" +..+. +. ", | |
" +.+. ++. ", | |
" +.+. ++++.. ", | |
" ++. ++++.... ", | |
" +++.... ", | |
" ... ", | |
" ", | |
" ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_BoundBoxVolume = [ | |
"24 24 9 1", | |
" c None", | |
". c #000000", | |
"+ c #140300", | |
"@ c #A40709", | |
"# c #CE000B", | |
"$ c #ED2928", | |
"% c #F02C30", | |
"& c #6A698F", | |
"* c #706E95", | |
" ", | |
" ++++ ", | |
" ++++$$$+ ", | |
" ++++$$$$%%%$+ ", | |
" +++$$$$%%%%%%%$+ ", | |
" ..$$%%%%%%%%%%%%$+ ", | |
" .$.%%%%%%%%%%%%..+ ", | |
" .#$.%%%%%%%%...@@$+ ", | |
" .##$.%%%....@@@@@$+ ", | |
" .###$...@@@@@@@@@$+ ", | |
" .###$.@@@@@@@@@@@$+ ", | |
" .###$.@@@@@@@@@@@$+ ", | |
" .###$.@@@@@@@@@@@$+ ", | |
" .$##$.@@@@@@@@@@@$+ ", | |
" .$#$.@@@@@@@@@@@$+ ", | |
" .$$.@@@@@@@@@@$$+ ", | |
" .$$.@@@@@@$$$$+++ ", | |
" .$.@@$$$$++++ ", | |
" ..$$++++ ", | |
" +++ ", | |
" ", | |
" ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_DeleteLineMaterial = [ | |
"24 24 9 1", | |
" c None", | |
". c #A30500", | |
"+ c #555755", | |
"@ c #F67904", | |
"# c #BCBCB3", | |
"$ c #D8DAD7", | |
"% c #E7E9E6", | |
"& c #EBEEEA", | |
"* c #F1F4F0", | |
" ", | |
" ", | |
" @ @ @ @ ", | |
" #@@#@@#@@#@@## ", | |
". ++@@+@@+@@+@@+# .", | |
"... +&@&&@&&@&&@&+# ...", | |
".....+&&&&&&&&&&&&+.....", | |
".......$$$$$$$$$$.......", | |
" ........######........ ", | |
" ........$$........ ", | |
" ..............# ", | |
" +&..........%+# ", | |
" +&..........&+# ", | |
" ..............# ", | |
" ........##........ ", | |
" ........$$$$$$........ ", | |
".......####$&&&&&.......", | |
".....+&$$$$$&&&&+++.....", | |
"... +&&&&%**&&+++## ...", | |
". +&&&%&***&++## .", | |
" +++++++++++## ", | |
" ########### ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_Beer = [ | |
"25 25 7 1", | |
" c None", | |
". c #000000", | |
"+ c #C17D11", | |
"@ c #BABDB6", | |
"# c #BDBDBA", | |
"$ c #D7D9D6", | |
"% c #EEEEEC", | |
" ", | |
" ", | |
" % % ", | |
" %%%% %% % ", | |
" % %% %% %% ", | |
" % %%%% %%% % % ", | |
" %%%@%%@%%%@%@%%% ", | |
" %%%%%@%%@%%%%%%% % ", | |
" %%%%@@%%%@%%@%. ", | |
" %%@%@%%@%%@%@%#... ", | |
" %%%$%%%%%%%%%%####.. ", | |
" %.$$%%@%%@%%%##.##. ", | |
" ..$.%%%%%%@.#. .#. ", | |
" .#%@.@.@.%%#. .#. ", | |
" .#+%%+@%%%+#. .#. ", | |
" .#+++++++++#. .#. ", | |
" .#+++++++++#. .#. ", | |
" .##++++++++#. .#. ", | |
" ..#++++++++#..##. ", | |
" .#++++++++#.##. ", | |
" .###+++++##... ", | |
" ...#####... ", | |
" ....... ", | |
" ", | |
" " | |
] | |
Macro_FCInfo_Save_Material = [ | |
"24 24 9 1", | |
" c None", | |
". c #000000", | |
"+ c #A30500", | |
"@ c #555755", | |
"# c #CD5D01", | |
"$ c #F67904", | |
"% c #BCBCB3", | |
"& c #EBEEEA", | |
"* c #F1F3F0", | |
" ", | |
" ", | |
" $ $ $ $ ", | |
" %$$%$$%$$%$$%% ", | |
" @@$$@$$@$$@$$@% ", | |
" @&$&&$&&$&&$&@% ", | |
" @&&&&&&&&&&&&@% ", | |
" @&&&&&&&&&&&&@% ", | |
" @&&%%%%%%%%&&@% ", | |
" @&&&&&&&&&&&&@% ", | |
" @&&%%..%&&&&&@% ", | |
" @&&&&.@@&&&&&@% ", | |
" @&&%%%@@@&&&&@% ", | |
" @&&&&&&@++&&&@% ", | |
" @&&%%%%++++&&@% ", | |
" @&&&&&&&++++&@% ", | |
" @&&%%%&&&++++@% ", | |
" @&&&&&&&&&++++% ", | |
" @&&&&&**&&@+++# ", | |
" @&&&&&***&@@+##$ ", | |
" @@@@@@@@@@@%%#$$$ ", | |
" %%%%%%%%%%% $$$$ ", | |
" $$ ", | |
" " | |
] | |
Macro_FCInfo_Work = [ | |
"24 24 8 1", | |
" c None", | |
". c #C17D11", | |
"+ c #8F5902", | |
"@ c #BABDB6", | |
"# c #EDD400", | |
"$ c #A40000", | |
"% c #CE5C00", | |
"& c #171018", | |
" ", | |
" ..... ", | |
" ++........ ", | |
" +...++++++... ", | |
" +..@@@@#@@@++.. ", | |
" +..#@@@@#@@@@#+.. ", | |
" +..@@#@@@#@@$#@@+.. ", | |
" +.#@@@%@@%@@$@@@#+. ", | |
" +..@#@@@@@#@$@@@#@+.. ", | |
" +.@@@%@@@@@$$@@%@@@+. ", | |
" +.@@@@@@@@@$$@@@@@@+. ", | |
" +.@@@@@@@@&&@@@@@@@+. ", | |
" +.###%@@@@&&@@@%###+. ", | |
" +.@@@@@@@@$$@@@@@@@+. ", | |
" +.@@@%@@@@@$$@@%@@@+. ", | |
" +..@#@@@@@#$$$@@#@+.. ", | |
" +.#@@@%@@%@$$@@@#+. ", | |
" ..@@#@@@#@@$$@@+.. ", | |
" +..#@@@@#@@@$#+.. ", | |
" +..@@@@#@@@++.. ", | |
" +...++++++... ", | |
" ++........ ", | |
" ...... ", | |
" " | |
] | |
Macro_FCInfo_Color = [ | |
"24 24 9 1", | |
" c None", | |
". c #16D0D2", | |
"+ c #D3D7CF", | |
"@ c #C17D11", | |
"# c #EDD400", | |
"$ c #73D216", | |
"% c #F57900", | |
"& c #3465A4", | |
"* c #CC0000", | |
" .... ", | |
" +++ .... @@@@ ", | |
" ++#### .... $$$ @@@@ ", | |
" ++####%%%...&&$$$ @@@@ ", | |
" ####%%% &&&&$$$ @@@@ ", | |
" ####%%%+&&&&** ", | |
" $$$$ ++&&&&**##%%% ", | |
"@@@@$$$$ ++++ ***##%%% ", | |
"@@@@$$$$ ++++ ####%%% ", | |
"@@@@ &&&$$$$## ", | |
"@@@$$$$ %%&&&$$$$ %%%% ", | |
" $$$$ %%&***$$$ %%%% ", | |
"...$$$$ %%%***$$$ %%%% ", | |
"...$$$$*** ***&&&+%%%% ", | |
"....%%%***### &&&+++@@@@", | |
"....%%%***### &&&+++@@@@", | |
" +++%% ### .... @@@@", | |
" +++ &&& $$$..####@@@@", | |
" +++ &&****$$..#### ", | |
" #### &&****$&&&###**** ", | |
" ####+++**...&&&###**** ", | |
" ####+++**...&&&& **** ", | |
" ####+++ ...&&&& **** ", | |
" .... " | |
] | |
Macro_FCInfo_Face = [ | |
"24 24 9 1", | |
" c None", | |
". c #A30500", | |
"+ c #9C0C04", | |
"@ c #9C0D0C", | |
"# c #EF2B29", | |
"$ c #5468F8", | |
"% c #A9B0CB", | |
"& c #98B5D8", | |
"* c #9EB7D5", | |
" ", | |
" ", | |
" ## ", | |
" ##++## ", | |
" ##++++++## ", | |
" ##++++++++++## ", | |
" ##@+++++++## ", | |
" ## $$*#++++++#**$ ", | |
" ##***##++##***$$ # ", | |
" ##**##***##***$$*$## ", | |
" #.#***##*****$*&*# # ", | |
" #..##***#$*$$**##$ # ", | |
" #....#***%$**##**$ # ", | |
" #.....##%%$*#****$ # ", | |
" #......#%%$#*****$ # ", | |
" #......#%%$#*****$ # ", | |
" #......#%%$#***&*$ # ", | |
" #......#%%$#***$$ # ", | |
" ##.....#%%$#*$$ ## ", | |
" ##...#$%$#$ # ", | |
" ##.# $$# ## ", | |
" ## ### ", | |
" # # ", | |
" " | |
] | |
#### Material, Gravity By Default Begin | |
global materialAssociated ; materialAssociated = [] # material associate | |
materialAssociated = [ | |
(u"Liquid Water (H2o),1,10.0,adapt Price"), | |
(u"Mater Beton,2.4,10.0,adapt Price"), | |
(u"Metal Aluminium (Al),2.7,10.0,adapt Price"), | |
(u"Metal Copper (Cu),8.96,10.0,adapt Price"), | |
(u"Metal Gold (Au),19.3,10.0,Gratis"), | |
(u"Metal Iron (Fe),7.87,10.0,adapt Price"), | |
(u"Metal Lead (Pb),11.35,10.0,adapt Price"), | |
(u"Metal Magnesium (Mg),1.43,10.0,adapt Price"), | |
(u"Metal Nickel (Ni),8.27,10.0,adapt Price"), | |
(u"Metal Pewter (Sn),7.29,10.0,adapt Price"), | |
(u"Metal Platinum (Pt),21.45,10.0,adapt Price"), | |
(u"Metal Silver (Ag),10.5,10.0,adapt Price"), | |
(u"Metal Sodium (Na),0.97,10.0,adapt Price"), | |
(u"Metal Titanium (Ti),4.4,10.0,adapt Price"), | |
(u"Metal Zinc (Zn),7.1,10.0,adapt Price"), | |
(u"Wood Beechwood,0.8,10.0,adapt Price"), | |
(u"Wood MDF,0.75,10.0,adapt Price"), | |
(u"Wood Mahogany,0.6,10.0,adapt Price"), | |
(u"Wood Oak,0.7,10.0,adapt Price"), | |
(u"Wood White pine,0.4,10.0,adapt Price") | |
] | |
if os.path.exists(path): | |
#App.Console.PrintMessage(str(os.path.exists(path)) + "\n") | |
#App.Console.PrintMessage(str(os.path.isfile(path + "FCInfo_material.txt")) + "\n") | |
# | |
#if not file one file (data default in macro) is created in the Macro location or in the seTMaterialSavePathName path | |
if (os.path.isfile(seTMaterialSavePathName + seTMaterialFileName) == False) or (os.path.getsize(seTMaterialSavePathName + seTMaterialFileName) == 0): # default "FCInfo_material.txt" | |
App.Console.PrintMessage("save " + str(seTMaterialSavePathName) + str(seTMaterialFileName) + "\n") | |
materialAssociated.sort() | |
App_Console_PrintMessage(u"Number material : " + str(len(materialAssociated)) + "\n") | |
try: | |
f = open(seTMaterialSavePathName + seTMaterialFileName, 'w') # write | |
for i in materialAssociated: | |
f.write(i + "\n") | |
f.close() | |
App_Console_PrintMessage(u"Create/Save file : " + seTMaterialFileName + "\n") | |
except Exception: | |
App.Console.PrintError(u"Not file " + seTMaterialFileName + "\n") | |
seTMaterialCurrentIndex = 0 | |
seTDensiteValue = float(materialAssociated[0].split(",")[1]) | |
else: | |
try: | |
App.Console.PrintMessage("read " + str(seTMaterialReadPathName) + str(seTMaterialFileName) + "\n") | |
f = open(seTMaterialReadPathName + seTMaterialFileName, 'r') # read # read the file | |
materialAssociated = [] | |
for i in f: | |
i2 = i.rstrip() # .lstrip(), .rstrip(), .split(",") | |
materialAssociated.append(i2) | |
f.close() | |
seTDensiteValue = float(materialAssociated[0].split(",")[1]) | |
App_Console_PrintMessage(u"Load the file : " + seTMaterialFileName + "\n") | |
except Exception: | |
App.Console.PrintError(u"Not read file " + seTMaterialFileName + " saved" + "\n") | |
#### Material, Gravity End | |
global infoFaceMesh; | |
global indexFaceMesh ; indexFaceMesh = 0 | |
global coordPointsMesh; coordPointsMesh = "" | |
import warnings | |
warnings.simplefilter("ignore") | |
def getNormal(cb): | |
#https://wiki.freecadweb.org/Code_snippets#Get_the_normal_vector_of_a_surface_from_a_STL_file | |
global infoFaceMesh; | |
global indexFaceMesh | |
try: | |
pp = cb.getPickedPoint() | |
indexFaceMesh = coin.cast(pp.getDetail(), "SoFaceDetail").getFaceIndex() | |
except Exception: | |
None | |
def Around(a) : | |
global seTDecimalValue | |
if seTDecimalValue == -1: | |
seTDecimalValue = 1000 | |
ard = round(a, seTDecimalValue) | |
return ard | |
#### BoundBox Tracing #### | |
def adjustedGlobalPlacement(obj, locVector): | |
'''find global placement to make locVector the local origin with the correct orientation''' | |
# extract BoundingBox_Tracing | |
#2021/07/10 modified by edwilliams16 to handle objects in nested part containers | |
#https://forum.freecadweb.org/viewtopic.php?f=22&t=59852 | |
# | |
try: | |
objectPlacement = obj.Placement | |
objectGlobalPlacement = obj.getGlobalPlacement() | |
locPlacement = App.Placement(locVector, App.Rotation(App.Vector(1,0,0),0)) | |
return objectGlobalPlacement.multiply(objectPlacement.inverse()).multiply(locPlacement) | |
except Exception: | |
locPlacement = App.Placement(App.Vector(0,0,0), App.Rotation(0,0,0), App.Vector(0,0,0)) | |
App.Console.PrintError(u"Error adjustedGlobalPlacement") | |
return locPlacement | |
def bounBoxTracing(): | |
#import PySide | |
global BDvol | |
global switchBoundBoxCreateVolume # 1 = create Volume | |
global switchBoundBoxCreateText # 1 = create dimension info : 0 = not dimension info | |
global seTBoundBoxTextHeigth # text heigth | |
global seTBoundBoxTextArround # arrondi text dimensions | |
##### Section configuration begin ################## | |
if int(FreeCAD.Version()[1]) > 17: # Version de FreeCAD | |
DisplayModeText = str(u"3D text") # available : u"2D text" or u"3D text" | |
else: | |
DisplayModeText = str(u"Screen") # available : u"Screen" or u"World" | |
JustificationText = str(u"Center") # available : "Center" or "Left" or "Right" | |
FontSizeText = seTBoundBoxTextHeigth# text info dimension | |
#### | |
TextColorText_R = 0.0 # text color info red 1 = 255 | |
TextColorText_G = 0.0 # text color info green 1 = 255 | |
TextColorText_B = 0.0 # text color info blue 1 = 255 | |
LineColor_red = 1.0 # Line Color rectangle 1 = 255 | |
LineColor_green = 0.0 # Line Color rectangle 1 = 255 | |
LineColor_blue = 0.0 # Line Color rectangle 1 = 255 | |
arrondi = seTBoundBoxTextArround # round the info ex: 3 = 3 decimals | |
##### Section configuration end #################### | |
sel = FreeCADGui.Selection.getSelection() | |
selEx = FreeCADGui.Selection.getSelectionEx() | |
objs = [selobj.Object for selobj in selEx] | |
if len(objs) >= 1: | |
if hasattr(objs[0], "Shape"): | |
s = objs[0].Shape | |
elif hasattr(objs[0], "Mesh"): # upgrade with wmayer thanks #http://forum.freecadweb.org/viewtopic.php?f=13&t=22331 | |
s = objs[0].Mesh | |
elif hasattr(objs[0], "Points"): | |
s = objs[0].Points | |
FreeCAD.ActiveDocument.openTransaction(u"FCInfo BBox") # memorise les actions (avec annuler restore) | |
#FreeCAD.ActiveDocument.commitTransaction() # restore les actions (avec annuler restore) | |
#FreeCAD.ActiveDocument.abortTransaction() # abandonne les actions(avec annuler restore) | |
# boundBox | |
boundBox_ = s.BoundBox | |
boundBoxLX = boundBox_.XLength | |
boundBoxLY = boundBox_.YLength | |
boundBoxLZ = boundBox_.ZLength | |
boundBoxXMin = boundBox_.XMin | |
boundBoxYMin = boundBox_.YMin | |
boundBoxZMin = boundBox_.ZMin | |
boundBoxLocation = App.Vector(boundBox_.XMin,boundBox_.YMin,boundBox_.ZMin) | |
nameLabel = sel[0].Label | |
try: | |
try: | |
import unicodedata | |
nameLabel = str(unicodedata.normalize('NFKD', nameLabel).encode('ascii','ignore'))[2:] | |
except Exception: | |
None | |
boundBoxLocation = App.Vector(boundBoxXMin,boundBoxYMin,boundBoxZMin) | |
nameLabel = sel[0].Label | |
# create Volume | |
if (switchBoundBoxCreateVolume == 1): | |
if (boundBoxLX > 0) and (boundBoxLY > 0) and (boundBoxLZ > 0): # Create Volume | |
BDvol = App.ActiveDocument.addObject("Part::Box",nameLabel + "_BoundBoxVolume") | |
#BDvol.Label = "BoundBoxVolume" | |
BDvol.Length.Value = boundBoxLX | |
BDvol.Width.Value = boundBoxLY | |
BDvol.Height.Value = boundBoxLZ | |
BDvol.Placement = adjustedGlobalPlacement(objs[0], boundBoxLocation) | |
BDPl = BDvol.Placement | |
oripl_X=BDvol.Placement.Base.x | |
oripl_Y=BDvol.Placement.Base.y | |
oripl_Z=BDvol.Placement.Base.z | |
#if debug: print(f'global {globalObjectPlacement}\n local {localObjectPlacement} BB {BBlocPlacement}') | |
FreeCADGui.ActiveDocument.getObject(BDvol.Name).LineColor = (LineColor_red, LineColor_green, LineColor_blue) | |
FreeCADGui.ActiveDocument.getObject(BDvol.Name).PointColor = (LineColor_red, LineColor_green, LineColor_blue) | |
FreeCADGui.ActiveDocument.getObject(BDvol.Name).ShapeColor = (LineColor_red, LineColor_green, LineColor_blue) | |
FreeCADGui.ActiveDocument.getObject(BDvol.Name).Transparency = 80 | |
switchBoundBoxCreateVolume = 0 | |
#App_Console_PrintMessage(nameLabel + "_BoundBoxVolume : " + str(BDvol.Shape.Volume)+"\r\n") | |
# create Text for volume | |
if switchBoundBoxCreateText == 1: # section create dimension info | |
conteneurVol = [] | |
del conteneurVol[:] | |
conteneurVol = App.activeDocument().addObject("App::DocumentObjectGroup",nameLabel + "_BoundBoxVolume_Info") | |
BDtext = FreeCAD.Placement() | |
BDtext = adjustedGlobalPlacement(objs[0], boundBoxLocation) | |
BDPl = BDtext | |
#pl_0C1 = Draft.make_text([str(round(boundBoxLX,arrondi))],point=FreeCAD.Vector(oripl_X + (boundBoxLX/2), oripl_Y, oripl_Z)) | |
pl_0C1 = Draft.make_text([str(round(boundBoxLX,arrondi))],placement = BDPl.multVec(App.Vector(boundBoxLX/2,0,0))) | |
pl_0C1.ViewObject.DisplayMode = DisplayModeText | |
pl_0C1.ViewObject.Justification = JustificationText | |
pl_0C1.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C1.ViewObject.FontSize = FontSizeText | |
pl_0C1.Label = nameLabel + "_Volume_X_" + str(round(boundBoxLX,arrondi)) | |
conteneurVol.addObject(pl_0C1) | |
#pl_0C2 = Draft.make_text([str(round(boundBoxLY,arrondi))],point=FreeCAD.Vector(oripl_X, oripl_Y + (boundBoxLY/2), oripl_Z)) | |
pl_0C2 = Draft.make_text([str(round(boundBoxLY,arrondi))],placement = BDPl.multVec(App.Vector(0, boundBoxLY/2, 0))) | |
pl_0C2.ViewObject.DisplayMode = DisplayModeText | |
pl_0C2.ViewObject.Justification = JustificationText | |
pl_0C2.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C2.ViewObject.FontSize = FontSizeText | |
pl_0C2.Label = nameLabel + "_Volume_Y_" + str(round(boundBoxLY,arrondi)) | |
conteneurVol.addObject(pl_0C2) | |
#pl_0C3 = Draft.make_text([str(round(boundBoxLZ,arrondi))],placement=FreeCAD.Vector(oripl_X, oripl_Y, oripl_Z + (boundBoxLZ/2))) | |
pl_0C3 = Draft.make_text([str(round(boundBoxLZ,arrondi))],placement = BDPl.multVec(App.Vector(0, 0, boundBoxLZ/2))) | |
pl_0C3.ViewObject.DisplayMode = DisplayModeText | |
pl_0C3.ViewObject.Justification = JustificationText | |
pl_0C3.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C3.ViewObject.FontSize = FontSizeText | |
pl_0C3.Label = nameLabel + "_Volume_Z_" + str(round(boundBoxLZ,arrondi)) | |
conteneurVol.addObject(pl_0C3) | |
App.ActiveDocument.recompute() | |
else: #create rectangles | |
conteneurRectangle = [] | |
del conteneurRectangle[:] | |
conteneurRectangle = App.activeDocument().addObject("App::DocumentObjectGroup",nameLabel + "_BoundBoxRectangle") | |
if switchBoundBoxCreateText == 1: # conteneur dimension info | |
conteneurInfo = [] | |
del conteneurInfo[:] | |
conteneurInfo = App.activeDocument().addObject("App::DocumentObjectGroup",nameLabel + "_BoundBoxRectangle_Info") | |
try: | |
if (boundBoxLX and boundBoxLY) > 0.0: | |
#pl_0 = App.Placement(App.Vector(oripl_X,oripl_Y,oripl_Z), App.Rotation(0.0,0.0,0.0)) | |
pl_0 = adjustedGlobalPlacement(objs[0], boundBoxLocation) | |
double = Draft.makeRectangle(length=boundBoxLX,height=boundBoxLY,placement=pl_0,face=False,support=None) #OK | |
double.Label = nameLabel + "_BoundBoxRectangle_Bo" | |
FreeCADGui.activeDocument().activeObject().LineColor = (LineColor_red, LineColor_green, LineColor_blue) | |
conteneurRectangle.addObject(double) | |
if switchBoundBoxCreateText == 1: # section create dimension info | |
#pl_0C1 = Draft.make_text([str(round(boundBoxLX,arrondi))],placement=FreeCAD.Vector(pl_0.Base.x + (boundBoxLX/2), pl_0.Base.y, pl_0.Base.z)) | |
# XY -> XY | |
pl_0C1 = Draft.make_text([str(round(boundBoxLX,arrondi))],placement=pl_0.multVec(App.Vector(boundBoxLX/2, 0, 0))) | |
pl_0C1.ViewObject.DisplayMode = DisplayModeText | |
pl_0C1.ViewObject.Justification = JustificationText | |
pl_0C1.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C1.ViewObject.FontSize = FontSizeText | |
pl_0C1.Label = nameLabel + "_Rectangle_Bo_0X_" + str(round(boundBoxLX,arrondi)) | |
conteneurInfo.addObject(pl_0C1) | |
#pl_0C2 = Draft.make_text([str(round(boundBoxLY,arrondi))],placement=FreeCAD.Vector(pl_0.Base.x, pl_0.Base.y + (boundBoxLY/2), pl_0.Base.z)) | |
pl_0C2 = Draft.make_text([str(round(boundBoxLY,arrondi))],placement=pl_0.multVec(App.Vector(0., boundBoxLY/2, 0.))) | |
pl_0C2.ViewObject.DisplayMode = DisplayModeText | |
pl_0C2.ViewObject.Justification = JustificationText | |
pl_0C2.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C2.ViewObject.FontSize = FontSizeText | |
pl_0C2.Label = nameLabel + "_Rectangle_Bo_0Y_" + str(round(boundBoxLY,arrondi)) | |
conteneurInfo.addObject(pl_0C2) | |
except: | |
App.Console.PrintError(u"not done 0"+"\n") | |
try: | |
if (boundBoxLX and boundBoxLY) > 0.0: | |
#pl_1 = App.Placement(App.Vector(oripl_X,oripl_Y,oripl_Z+boundBoxLZ), App.Rotation(0.0,0.0,0.0)) | |
pl_1 =adjustedGlobalPlacement(objs[0], boundBoxLocation + App.Vector(0,0,boundBoxLZ)) | |
double = Draft.makeRectangle(length=boundBoxLX,height=boundBoxLY,placement=pl_1,face=False,support=None) #Ok | |
double.Label = nameLabel + "_BoundBoxRectangle_To" | |
FreeCADGui.activeDocument().activeObject().LineColor = (LineColor_red, LineColor_green, LineColor_blue) | |
conteneurRectangle.addObject(double) | |
if switchBoundBoxCreateText == 1: # section create dimension info | |
#pl_0C1 = Draft.make_text([str(round(boundBoxLX,arrondi))],placement=FreeCAD.Vector(pl_1.Base.x + (boundBoxLX/2), pl_1.Base.y, pl_1.Base.z)) | |
#XY -> XY | |
pl_0C1 = Draft.make_text([str(round(boundBoxLX,arrondi))],placement=pl_1.multVec(App.Vector(boundBoxLX/2, 0, 0))) | |
pl_0C1.ViewObject.DisplayMode = DisplayModeText | |
pl_0C1.ViewObject.Justification = JustificationText | |
pl_0C1.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C1.ViewObject.FontSize = FontSizeText | |
pl_0C1.Label = nameLabel + "_Rectangle_To_1X_" + str(round(boundBoxLX,arrondi)) | |
conteneurInfo.addObject(pl_0C1) | |
#pl_0C2 = Draft.make_text([str(round(boundBoxLY,arrondi))],placement=FreeCAD.Vector(pl_1.Base.x, pl_1.Base.y + (boundBoxLY/2), pl_1.Base.z)) | |
pl_0C2 = Draft.make_text([str(round(boundBoxLY,arrondi))],placement=pl_1.multVec(App.Vector(0., boundBoxLY/2, 0))) | |
pl_0C2.ViewObject.DisplayMode = DisplayModeText | |
pl_0C2.ViewObject.Justification = JustificationText | |
pl_0C2.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C2.ViewObject.FontSize = FontSizeText | |
pl_0C2.Label = nameLabel + "_Rectangle_To_1Y_" + str(round(boundBoxLY,arrondi)) | |
conteneurInfo.addObject(pl_0C2) | |
except: | |
App.Console.PrintError(u"not done 1"+"\n") | |
try: | |
if (boundBoxLX and boundBoxLZ) > 0.0: | |
#pl_2 = App.Placement(App.Vector(oripl_X,oripl_Y,oripl_Z), App.Rotation(0.0,0.0,90)) | |
pl_2 = pl_0.multiply(App.Placement(App.Vector(0.,0.,0.),App.Rotation(0.0,0.0,90))) | |
double = Draft.makeRectangle(length=boundBoxLX,height=boundBoxLZ,placement=pl_2,face=False,support=None) #Ok | |
double.Label = nameLabel + "_BoundBoxRectangle_Fr" | |
FreeCADGui.activeDocument().activeObject().LineColor = (LineColor_red, LineColor_green, LineColor_blue) | |
conteneurRectangle.addObject(double) | |
if switchBoundBoxCreateText == 1: # section create dimension info | |
#pl_0C1 = Draft.make_text([str(round(boundBoxLX,arrondi))],placement=FreeCAD.Vector(pl_2.Base.x + (boundBoxLX/2), pl_2.Base.y, pl_2.Base.z)) | |
#XZ -> XY | |
pl_0C1 = Draft.make_text([str(round(boundBoxLX,arrondi))],placement=pl_2.multVec(App.Vector(boundBoxLX/2, 0, 0))) | |
pl_0C1.ViewObject.DisplayMode = DisplayModeText | |
pl_0C1.ViewObject.Justification = JustificationText | |
pl_0C1.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C1.ViewObject.FontSize = FontSizeText | |
pl_0C1.Label = nameLabel + "_Rectangle_Fr_2X_" + str(round(boundBoxLX,arrondi)) | |
conteneurInfo.addObject(pl_0C1) | |
#pl_0C2 = Draft.make_text([str(round(boundBoxLZ,arrondi))],placement=FreeCAD.Vector(pl_2.Base.x, pl_2.Base.y, pl_2.Base.z + (boundBoxLZ/2))) | |
pl_0C2 = Draft.make_text([str(round(boundBoxLZ,arrondi))],placement=pl_2.multVec(App.Vector(0, boundBoxLZ/2, 0))) | |
pl_0C2.ViewObject.DisplayMode = DisplayModeText | |
pl_0C2.ViewObject.Justification = JustificationText | |
pl_0C2.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C2.ViewObject.FontSize = FontSizeText | |
pl_0C2.Label = nameLabel + "_Rectangle_Fr_2Z_" + str(round(boundBoxLZ,arrondi)) | |
conteneurInfo.addObject(pl_0C2) | |
except: | |
App.Console.PrintError(u"not done 2"+"\n") | |
try: | |
if (boundBoxLX and boundBoxLZ) > 0.0: | |
#pl_3 = App.Placement(App.Vector(oripl_X,oripl_Y+boundBoxLY,oripl_Z), App.Rotation(0.0,0.0,90)) | |
pl_3 = adjustedGlobalPlacement(objs[0], boundBoxLocation+App.Vector(0, boundBoxLY, 0)).multiply(App.Placement(App.Vector(0.,0.,0.),App.Rotation(0.0,0.0,90))) | |
double = Draft.makeRectangle(length=boundBoxLX,height=boundBoxLZ,placement=pl_3,face=False,support=None) #Ok | |
double.Label = nameLabel + "_BoundBoxRectangle_Re" | |
FreeCADGui.activeDocument().activeObject().LineColor = (LineColor_red, LineColor_green, LineColor_blue) | |
conteneurRectangle.addObject(double) | |
if switchBoundBoxCreateText == 1: # section create dimension info | |
#XZ -> XY | |
pl_0C1 = Draft.make_text([str(round(boundBoxLX,arrondi))],placement=pl_3.multVec(App.Vector(boundBoxLX/2, 0, 0))) | |
pl_0C1.ViewObject.DisplayMode = DisplayModeText | |
pl_0C1.ViewObject.Justification = JustificationText | |
pl_0C1.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C1.ViewObject.FontSize = FontSizeText | |
pl_0C1.Label = nameLabel + "_Rectangle_Re_3X_" + str(round(boundBoxLX,arrondi)) | |
conteneurInfo.addObject(pl_0C1) | |
pl_0C2 = Draft.make_text([str(round(boundBoxLZ,arrondi))],placement=pl_3.multVec(App.Vector(0, boundBoxLZ/2, 0))) | |
pl_0C2.ViewObject.DisplayMode = DisplayModeText | |
pl_0C2.ViewObject.Justification = JustificationText | |
pl_0C2.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C2.ViewObject.FontSize = FontSizeText | |
pl_0C2.Label = nameLabel + "_Rectangle_Re_3Z_" + str(round(boundBoxLZ,arrondi)) | |
conteneurInfo.addObject(pl_0C2) | |
except: | |
App.Console.PrintError(u"not done 3"+"\n") | |
try: | |
if (boundBoxLY and boundBoxLZ) > 0.0: | |
#pl_4 = App.Placement(App.Vector(oripl_X,oripl_Y,oripl_Z), App.Rotation(90,0.0,90)) | |
pl_4 = pl_0.multiply(App.Placement(App.Vector(0.,0.,0.),App.Rotation(90,0,90))) | |
double = Draft.makeRectangle(length=boundBoxLY,height=boundBoxLZ,placement=pl_4,face=False,support=None) #Ok | |
double.Label = nameLabel + "_BoundBoxRectangle_Le" | |
FreeCADGui.activeDocument().activeObject().LineColor = (LineColor_red, LineColor_green, LineColor_blue) | |
conteneurRectangle.addObject(double) | |
if switchBoundBoxCreateText == 1: # section create dimension info | |
#pl_0C1 = Draft.make_text([str(round(boundBoxLY,arrondi))],placement=FreeCAD.Vector(pl_4.Base.x, pl_4.Base.y + (boundBoxLY/2), pl_4.Base.z)) | |
#YZ ->XY | |
pl_0C1 = Draft.make_text([str(round(boundBoxLY,arrondi))],placement=pl_4.multVec(App.Vector(boundBoxLY/2, 0., 0.))) | |
pl_0C1.ViewObject.DisplayMode = DisplayModeText | |
pl_0C1.ViewObject.Justification = JustificationText | |
pl_0C1.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C1.ViewObject.FontSize = FontSizeText | |
pl_0C1.Label = nameLabel + "_Rectangle_Le_4Y_" + str(round(boundBoxLY,arrondi)) | |
conteneurInfo.addObject(pl_0C1) | |
#pl_0C2 = Draft.make_text([str(round(boundBoxLZ,arrondi))],placement=FreeCAD.Vector(pl_4.Base.x, pl_4.Base.y, pl_4.Base.z + (boundBoxLZ/2))) | |
pl_0C2 = Draft.make_text([str(round(boundBoxLZ,arrondi))],placement=pl_4.multVec(App.Vector(0., boundBoxLZ/2, 0))) | |
pl_0C2.ViewObject.DisplayMode = DisplayModeText | |
pl_0C2.ViewObject.Justification = JustificationText | |
pl_0C2.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C2.ViewObject.FontSize = FontSizeText | |
pl_0C2.Label = nameLabel + "_Rectangle_Le_4Z_" + str(round(boundBoxLZ,arrondi)) | |
conteneurInfo.addObject(pl_0C2) | |
except: | |
App.Console.PrintError(u"not done 4"+"\n") | |
try: | |
if (boundBoxLY and boundBoxLZ) > 0.0: | |
#pl_5 = App.Placement(App.Vector(oripl_X+boundBoxLX,oripl_Y,oripl_Z), App.Rotation(90,0.0,90)) | |
pl_5 = adjustedGlobalPlacement(objs[0], boundBoxLocation+App.Vector(boundBoxLX,0,0)).multiply(App.Placement(App.Vector(0.,0.,0.),App.Rotation(90,0.0,90))) | |
double = Draft.makeRectangle(length=boundBoxLY,height=boundBoxLZ,placement=pl_5,face=False,support=None) #Ok | |
double.Label = nameLabel + "_BoundBoxRectangle_Ri" | |
FreeCADGui.activeDocument().activeObject().LineColor = (LineColor_red, LineColor_green, LineColor_blue) | |
conteneurRectangle.addObject(double) | |
if switchBoundBoxCreateText == 1: # section create dimension info | |
#YZ-> XY | |
pl_0C1 = Draft.make_text([str(round(boundBoxLY,arrondi))],placement=pl_5.multVec(App.Vector(boundBoxLY/2, 0, 0))) | |
pl_0C1.ViewObject.Justification = JustificationText | |
pl_0C1.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C1.ViewObject.FontSize = FontSizeText | |
pl_0C1.Label = nameLabel + "_Rectangle_Ri_5Y_" + str(round(boundBoxLY,arrondi)) | |
conteneurInfo.addObject(pl_0C1) | |
pl_0C2 = Draft.make_text([str(round(boundBoxLZ,arrondi))],placement=pl_5.multVec(App.Vector(0, boundBoxLZ/2, 0 ))) | |
pl_0C2.ViewObject.DisplayMode = DisplayModeText | |
pl_0C2.ViewObject.Justification = JustificationText | |
pl_0C2.ViewObject.TextColor = (TextColorText_R, TextColorText_G, TextColorText_B) | |
pl_0C2.ViewObject.FontSize = FontSizeText | |
pl_0C2.Label = nameLabel + "_Rectangle_Ri_5Z_" + str(round(boundBoxLZ,arrondi)) | |
conteneurInfo.addObject(pl_0C2) | |
except: | |
App.Console.PrintError(u"not done 5"+"\n") | |
##### | |
App.ActiveDocument.recompute() | |
except Exception: | |
App.Console.PrintError(u"Bad selection"+"\n") | |
else: | |
App_Console_PrintMessage(u"Select an object !"+"\n") | |
############################################################################################################## | |
def axisPlane( posX = 0.0, posY = 0.0, posZ = 0.0, namePlane = "FCPlane"): # plane creation | |
global sel | |
global document_ | |
global object_Name | |
global boundBoxDiag | |
global switchInertia | |
global seTMemoClipBoard | |
global switchCreatePoint | |
global switchCreateAxis | |
global switchCreatePlane | |
global directionObj | |
FreeCAD.ActiveDocument.openTransaction(u"FCInfo Plane") # memorise les actions (avec annuler restore) | |
#FreeCAD.ActiveDocument.commitTransaction() # restore les actions (avec annuler restore) | |
#FreeCAD.ActiveDocument.abortTransaction() # abandonne les actions(avec annuler restore) | |
sel = FreeCADGui.Selection.getSelection() | |
retour = Macro_FCInfo_05 # icone dans une variable (ok / ko) | |
switchInertia = 1 | |
if seTMemoClipBoard >= 1: # memo clipBoard | |
memo = QtWidgets.QApplication.clipboard() | |
memo.clear(mode=memo.Clipboard ) | |
if seTMemoClipBoard == 1: | |
memo.setText(u"FreeCAD.Vector("+str(Around(posX))+", "+str(Around(posY))+", "+str(Around(posZ))+")", mode = memo.Clipboard) # format : FreeCAD.Vector(x, y, z) | |
elif seTMemoClipBoard == 2: | |
memo.setText(str(Around(posX))+", "+str(Around(posY))+", "+str(Around(posZ)), mode = memo.Clipboard) # format : x, y, z | |
elif seTMemoClipBoard == 3: | |
memo.setText(str(Around(posX))+" "+str(Around(posY))+" "+str(Around(posZ)), mode = memo.Clipboard) # format : x y z | |
if switchCreatePoint == 1: | |
try: # create point | |
point = Draft.makePoint( posX, posY, posZ) | |
point.ViewObject.PointColor = (1.0,0.0,0.0) | |
point.Label = u"FCPoint" + namePlane | |
retour = Macro_FCInfo_06 | |
FreeCADGui.updateGui() # updateGui | |
App.ActiveDocument.recompute() | |
except Exception: | |
retour = Macro_FCInfo_07 | |
if switchCreatePlane == 1: | |
try: # create plane | |
doc = App.activeDocument() | |
if boundBoxDiag == 0.0: | |
boundBoxDiag = 10.0 | |
boundBoxLX = boundBoxLY = boundBoxLZ = boundBoxDiag | |
FCSpring = doc.addObject(u"App::DocumentObjectGroup", "FCPlane" + namePlane) | |
plr = FreeCAD.Placement() | |
plr.Base = FreeCAD.Vector( posX, posY, posZ) | |
### PlaneX-R | |
plan = App.ActiveDocument.addObject("Part::Plane","PlaneX-R") | |
plan.Length=boundBoxLZ | |
plan.Width=boundBoxLX | |
plan.Placement = plr | |
plan.Placement.Rotation = plan.Placement.Rotation.multiply(App.Rotation(0.0,-90.0,0.0)) | |
plan.Placement = plan.Placement.multiply(App.Placement(App.Vector(-float(plan.Length)/2.0,-float(plan.Width)/2.0,0.0), App.Rotation(App.Vector(0.0,0.0,0.0),0.0), App.Vector(0.0,0.0,0.0))) | |
plan.ViewObject.LineColor = (1.0,0.66667,0.0) | |
plan.ViewObject.ShapeColor = (0.6, 0.0, 0.0) | |
plan.ViewObject.Transparency = 90 | |
plan.ViewObject.LineWidth = 1.0 | |
FCSpring.addObject(plan) | |
### PlaneY-V | |
plan = App.ActiveDocument.addObject("Part::Plane","PlaneY-V") | |
plan.Length=boundBoxLY | |
plan.Width=boundBoxLZ | |
plan.Placement = plr | |
plan.Placement.Rotation = plan.Placement.Rotation.multiply(App.Rotation(0.0,0.0,90.0)) | |
plan.Placement = plan.Placement.multiply(App.Placement(App.Vector(-float(plan.Length)/2.0,-float(plan.Width)/2.0,0.0), App.Rotation(App.Vector(0.0,0.0,0.0),0.0), App.Vector(0.0,0.0,0.0))) | |
plan.ViewObject.LineColor = (1.0, 0.66667, 0.0) | |
plan.ViewObject.ShapeColor = (0.0, 0.6, 0.0) | |
plan.ViewObject.Transparency = 90 | |
plan.ViewObject.LineWidth = 1.0 | |
FCSpring.addObject(plan) | |
### PlaneZ-B | |
plan = App.ActiveDocument.addObject("Part::Plane","PlaneZ-B") | |
plan.Length=boundBoxLX | |
plan.Width=boundBoxLY | |
plan.Placement = plr | |
plan.Placement = plan.Placement.multiply(App.Placement(App.Vector(-float(plan.Length)/2.0,-float(plan.Width)/2.0,0.0), App.Rotation(App.Vector(0.0,0.0,0.0),0.0), App.Vector(0.0,0.0,0.0))) | |
plan.ViewObject.LineColor = (1.0,1.0,1.0) | |
plan.ViewObject.ShapeColor = (0.0,0.0,0.6) | |
plan.ViewObject.Transparency = 90 | |
plan.ViewObject.LineWidth = 1.0 | |
FCSpring.addObject(plan) | |
FreeCADGui.updateGui() # updateGui | |
App.ActiveDocument.recompute() | |
retour = Macro_FCInfo_06 | |
except Exception: | |
retour = Macro_FCInfo_07 | |
if switchCreateAxis == 1: # create axis | |
try: | |
doc = App.activeDocument() | |
if boundBoxDiag == 0.0: | |
boundBoxDiag = 10.0 | |
boundBoxLX = boundBoxLY = boundBoxLZ = boundBoxDiag | |
FCSpring = doc.addObject("App::DocumentObjectGroup", "FCAxis" + namePlane) | |
plr = FreeCAD.Placement() | |
plr.Base = FreeCAD.Vector( posX, posY, posZ) | |
#create axis | |
points=[FreeCAD.Vector(0.0,0.0,0.0),FreeCAD.Vector(0.0,0.0,boundBoxLX)] | |
centerX = Draft.makeWire(points,closed=False,face=False,support=None) | |
centerX.Placement = plr | |
centerX.Placement.Rotation = centerX.Placement.Rotation.multiply(App.Rotation(0.0,90.0,0.0)) | |
centerX.Placement = centerX.Placement.multiply(App.Placement(App.Vector(0.0,0.0,-float(boundBoxLX)/2.0), App.Rotation(App.Vector(0.0,0.0,0.0),0.0), App.Vector(0.0,0.0,0.0))) | |
centerX.ViewObject.LineColor = (1.0,1.0,1.0) | |
centerX.ViewObject.LineWidth = 1.0 | |
centerX.ViewObject.DrawStyle = str(u"Dashdot") | |
centerX.Label = str(u"Axis White PlaneX") | |
FCSpring.addObject(centerX) | |
points=[FreeCAD.Vector(0.0,0.0,0.0),FreeCAD.Vector(0.0,0.0,boundBoxLX)] | |
centerY = Draft.makeWire(points,closed=False,face=False,support=None) | |
centerY.Placement = plr | |
centerY.Placement.Rotation = centerY.Placement.Rotation.multiply(App.Rotation(0.0,90.0,90.0)) | |
centerY.Placement = centerY.Placement.multiply(App.Placement(App.Vector(0.0,0.0,-float(boundBoxLX)/2.0), App.Rotation(App.Vector(0.0,0.0,0.0),0.0), App.Vector(0.0,0.0,0.0))) | |
centerY.ViewObject.LineColor = (1.0,1.0,1.0) | |
centerY.ViewObject.LineWidth = 1.0 | |
centerY.ViewObject.DrawStyle = str(u"Dashdot") | |
centerY.Label = str(u"Axis White PlaneY") | |
FCSpring.addObject(centerY) | |
points=[FreeCAD.Vector(0.0,0.0,0.0),FreeCAD.Vector(0.0,0.0,boundBoxLX)] | |
centerZ = Draft.makeWire(points,closed=False,face=False,support=None) | |
centerZ.Placement = plr | |
centerZ.Placement.Rotation = centerZ.Placement.Rotation.multiply(App.Rotation(0,0,0)) | |
centerZ.Placement = centerZ.Placement.multiply(App.Placement(App.Vector(0.0,0.0,-float(boundBoxLX)/2.0), App.Rotation(App.Vector(0.0,0.0,0.0),0.0), App.Vector(0.0,0.0,0.0))) | |
centerZ.ViewObject.LineColor = (1.0,1.0,1.0) | |
centerZ.ViewObject.LineWidth = 1.0 | |
centerZ.ViewObject.DrawStyle = str(u"Dashdot") | |
centerZ.Label = str(u"Axis White PlaneZ") | |
FCSpring.addObject(centerZ) | |
FreeCADGui.updateGui() # updateGui | |
App.ActiveDocument.recompute() | |
retour = Macro_FCInfo_06 | |
except Exception: | |
retour = Macro_FCInfo_07 | |
try: | |
Gui.Selection.addSelection(App.ActiveDocument.getObject(object_Name)) | |
except Exception: | |
None | |
#FreeCAD.ActiveDocument.commitTransaction() # restore les actions (avec annuler restore) | |
#FreeCAD.ActiveDocument.abortTransaction() # abandonne les actions(avec annuler restore) | |
FreeCADGui.updateGui() # updateGui | |
switchInertia = 0 | |
return retour | |
def tableau(): | |
global sel | |
global subElemName | |
global perimetre | |
global numberEdges | |
global Vertx | |
global Edges | |
global EdgesLong | |
global Faces | |
global FacesSurf | |
global FacesCoor | |
global compt_E | |
global compt_F | |
global compt_VF | |
global RowCountTest | |
global angleX1 | |
global angleY1 | |
global angleZ1 | |
global angleX2 | |
global angleY2 | |
global angleZ2 | |
if len(sel) != 0: | |
Vertx=[] | |
Edges=[] | |
Faces=[] | |
compt_E = 0 | |
compt_F = 0 | |
compt_VF = 0 | |
perimetre = 0.0 | |
EdgesLong = [] | |
angleX1 = 0.0 | |
angleY1 = 0.0 | |
angleZ1 = 0.0 | |
angleX2 = 0.0 | |
angleY2 = 0.0 | |
angleZ2 = 0.0 | |
numberEdges = len(sel[0].Shape.Edges) | |
for j in enumerate(sel[0].Shape.Edges): # search 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(u"X1: "+str(a.Point.x)) | |
Vertx.append(u"Y1: "+str(a.Point.y)) | |
Vertx.append(u"Z1: "+str(a.Point.z)) | |
try: | |
a = sel[0].Shape.Edges[compt_E-1].Vertexes[1] # search Vertexes Edges | |
Vertx.append(u"X2: "+str(a.Point.x)) | |
Vertx.append(u"Y2: "+str(a.Point.y)) | |
Vertx.append(u"Z2: "+str(a.Point.z)) | |
except Exception: | |
Vertx.append(u"-") | |
Vertx.append(u"-") | |
Vertx.append(u"-") | |
FacesSurf = [] | |
FacesCoor = [] | |
for j in enumerate(sel[0].Shape.Faces): # search Faces | |
compt_F+=1 | |
Faces.append(u"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: # search Vertexes face | |
fco += 1 | |
FacesCoor.append(u"X"+str(fco)+": "+str(f0.Point.x)) | |
FacesCoor.append(u"Y"+str(fco)+": "+str(f0.Point.y)) | |
FacesCoor.append(u"Z"+str(fco)+": "+str(f0.Point.z)) | |
compt_VF += 1 | |
FacesCoor += (u"T",) | |
RowCountTest = compt_E + compt_F + compt_VF | |
# encoder 3 couleurs et transparence renvoye la valeur (unsigned pour Preferences FC) | |
def unsignedEncode(red = 0, green = 0, blue = 0, transparent = 1): # | |
#(255 *256*256*256 ) + (85 *256*256) + (51 *256) +(1*255) = 4283773951 | |
red = int(red*255) | |
green = int(green*255) | |
blue = int(blue*255) | |
transparent = int(transparent*255) | |
value = int((red*pow(256,3)) + (green*pow(256,2)) + (blue*pow(256,1)) + (transparent*pow(256,0))) | |
return value | |
# converti decimal en hexadecimal | |
def decimalTohexa(decimal = 0): | |
# 5 = "05" | |
hexa = str(hex(int(decimal)))[2:4] | |
if len(hexa) == 1: | |
hexa = "0" + hexa | |
return hexa | |
def affect(passTableau): | |
global ui | |
global sel | |
global document_ | |
global object_Label | |
global object_Name | |
global typeObject | |
global object_Type | |
global subElemName | |
global RotationToEuler | |
global position0 | |
global position1 | |
global position2 | |
global diffuseColorRF | |
global diffuseColorVF | |
global diffuseColorBF | |
global diffuseColorTF | |
global transparenceFace | |
global unsignedEncodeColor | |
global cols | |
global colorShapeFace | |
global colorShapeLine | |
global colorShapePoint | |
global BsplineRayonApproximatif | |
global longueurObjet | |
global rayonObjet | |
global perimetre | |
global numberEdges | |
global nombreArretesMesh | |
global nombreFacesMesh | |
global nombrePointsMesh | |
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 seTDensiteValue | |
global poids | |
global uniteM | |
global uniteMs | |
global uniteS | |
global uniteSs | |
global uniteV | |
global uniteVs | |
global uniteP | |
global unitePs | |
global uniteAs | |
global boundBox_ | |
global boundBoxLX | |
global boundBoxLY | |
global boundBoxLZ | |
global boundBox_S | |
global BDvol | |
global adaptWithBody | |
global boundBoxCenterX | |
global boundBoxCenterY | |
global boundBoxCenterZ | |
global boundBoxDiag | |
global boundBoxXMin | |
global boundBoxYMin | |
global boundBoxZMin | |
global CenterOfMassX | |
global CenterOfMassY | |
global CenterOfMassZ | |
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 DeterminantM | |
global FacesSurf | |
global EdgesLong | |
global FacesCoor | |
global angleX1 | |
global angleY1 | |
global angleZ1 | |
global angleX2 | |
global angleY2 | |
global angleZ2 | |
global directionObj | |
global direcValueAt | |
global direcNormalAt | |
global typeNormalAt | |
global switchDisplayInfoObject | |
global MatrixX1_16 | |
global MatrixY1_16 | |
global MatrixZ1_16 | |
global MatrixX2_16 | |
global MatrixY2_16 | |
global MatrixZ2_16 | |
global MatrixX3_16 | |
global MatrixY3_16 | |
global MatrixZ3_16 | |
global MatrixX1_17 | |