Macro FCInfo/de

FC Information

Beschreibung
Gibt Informationen über die ausgewählte Form aus und kann umgewandelte Werte von Länge, Neigung (Grad, Bogenmaß, Steigung, Prozent), Flächeninhalt, Volumen und Gewicht in verschieden Einheiten (metrisch und imperial (US/GB)) anzeigen. Das Makro funktioniert jetzt auch mit Elementen einer Skizze im Bearbeitungsmodus.


French Version französische Version

Versionsmakro : 1.30c
Datum der letzten Änderung : 2025/01/28
FreeCAD version : Alle
Herunterladen : Werkzeugleisten-Symbol
Autor: Mario52

Autor
Mario52
Herunterladen
Werkzeugleisten-Symbol
Links
Macro-Version
1.30c
Datum der letzten Änderung
2025/01/28
FreeCAD-Version(s)
Alle
Standardverknüpfung
None
Siehe auch
Arch Inspizieren, Makro Einfache Eigenschaften, Makro FC Gläserne Information

Beschreibung

Gibt Informationen über die ausgewählte Form aus und kann eine Umwandlung von Länge, Neigung (Grad, Bogenmaß, Neigung, Prozent), Flächeninhalt, Volumen und Gewicht in unterschiedliche Einheiten (metrisch oder imperial) anzeigen. Das Makro arbeitet jetzt auch mit den Elementen einer Skizze im Bearbeitungsmodus.

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


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

from PySide import QtGui, QtCore

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

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

import webbrowser 
webbrowser.open("https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro")
<class="rawcodeurl"><a href="https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro">raw code</a>


FCInfo

Anwendung

Ein Objekt auswählen und die Anwendung starten oder zuerst die Anwendung starten und dann ein Objekt auswählen. Das Objekt wird analysiert und ein Dialog wird geöffnet, der die gesammelten Informationen anzeigt. Mit jeder neuen Auswahl wird die Längeneinheit auf mm zurückgesetzt und die Winkeleinheit auf Dezimalgrad.

window
window


Abschnitt 1: Dokument

FCInfo Dokument

(Die Variable switch_setVisible_GBox_001_Document kann auf false gesetzt werden, um die Tafel auszublenden)

Abschnitt 2: Mausklick-Koordinaten

FCInfo Koordinate

(Die Variable switch_setVisible_GBox_002_Coordinate_Mouse kann auf false gesetzt werden, um die Tafel auszublenden)

Abschnitt 3: Color on point

FCInfo Color_on_point

(Die Variable switch_setVisible_GBox_003_Color kann auf false gesetzt werden, um die Tafel auszublenden)

Abschnitt 4: Netz-Komponenten

FCInfo Netz-Komponenten

Wenn ein Netz-Objekt ausgewählt ist, wird ein neues Fenster "Komponenten" angezeigt und gibt:

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

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

Abschnitt 5: Einheiten

FCInfo Einheiten

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

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

Abschnitt 6: Neigung

FCInfo Neigung

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

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

Abschnitt 7: Oberfläche und Volumen

FCInfo Oberfläche und Volumen

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

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

Abschnitt 8: Kosten

FCInfo Kosten

  • Cost total : cost total of the object selected

0.027 Eu

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

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

Abschnitt 9: Begrenzungsrahmen

FCInfo Begrenzungsrahmen

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

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

Abschnitt 10: Zentrum von:

FCInfo Zentrum von ...

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

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

Abschnitt 11: Trägheit

FCInfo Trägheit

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

same for length and weigth

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

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

Abschnitt 12: Tabelle

FCInfo ausgeschaltet

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

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

Abschnitt 13: Tabellenerstellung

FCInfo Tabelle

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

Optionen zum Speichern (Save) oder Öffnen (Read) von Tabellen mit unterschiedlichen Trennzeichen wie Tab, Komma, Semikolon, Leerzeichen
Tab(ulation) ist das Trennzeichen für FreeCADs Arbeitsbereich [Spreadsheet_Workbench/de|Spreadsheet]
Die Nummer dieser vier Trennzeichen wird für Hilfe berechnet, falls unbekannt
Das KOMMA ist das alte Trennzeichen (01.16 und davor) des FCInfo-Makros
Aus Kompatibilitätsgründen mit FreeCAD-Spreadsheet und seit Version 01.17 ist TAB (Tabulation) standardmäßig das Trennzeichen.
Wenn eine alte Kalkulationstabelle umgewandelt werden soll: Diese in FCInfo öffnen und mit aktivierter Option Tabulation speichern.
(Die Variable switch_setVisible_GBox_013_SpreadSheet_Creation kann auf false gesetzt werden, um die Tafel auszublenden).

Abschnitt 14: Hauptwerkzeuge

FCInfo Hauptwerkzeuge

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

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

Nach dem Starten des Makros bleibt das Makro aktiv und das Fenster bleibt sichtbar. Zum Verlassen des Makros Exit drücken. Wird das Makro über die Kreuz-Schaltfläche verlassen, bleibt das Makro im Speicher und die Daten werden im "Ausgabefenster" von FreeCAD angezeigt; jetzt muss FreeCAD neu gestartet werden, um es zu verlassen.

Optionen

Die verwendete Einheit

Längeneinheit:

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

Winkelgrade :

  1. Grad, dezimal, z.B.: 174.831872611°
  2. Grad, Minute, sekunde, z.B.: 174° 49' 54.741401''
  3. Radiant, z.B.: 3.05139181449 rad
  4. geodätischer Winkel, z.B.: 194.257636235 gon
  5. Prozent, z.B.: 30° = 57.74%

Winkel in der FCInfo-Anzeige.

Gewichtseinheit :

ton, quintal, kg, hg, dag, gram, dg, cg, mg, µg, ng, pg, fg, gr (grain), dr (drachm), oz (once), oz t (once troy),
lb t (livre troy), lb (livre av), st (stone), qtr (quarter), cwt (hundredweight), tonneau fr, ct

FCInfo-Konfiguration

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


Der Schalter (section GroupBox) ermöglicht es, nur die gewünschten Abschnitte anzuzeigen (nur visuell) Template:Falsch or Template:Wahr.

Alle Berechnungen werden ohne Berücksichtigung dieser Option durchgeführt

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

Skript

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

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

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

PS: Der Code ist zu lang, um in der Wiki-Seite enthalten zu sein (zur Zeit akzeptieren die Wiki-Seiten nur 64 KB), daher wurde der Makrocode in das Forum
gestellt

Die Makrodatei docked to right herunterladen


(Oder On the forum. )

PS: Dieses Makro verwendet getSelection () und die Objektliste beginnt mit 1 z.B. für eine Box Edge1 bis Edge12 und der Code in der Konsole beginnt bei 0 z.B. für eine Box Edge [0] to Edge [11]
Dies ist normal; die Zählung von Arrays bzw. Listen in OpenCascade beginnt immer bei 1 und nicht bei 0

Einschränkungen

Immer mit der Schaltfläche Exit verlassen. Wird das Programm verlassen, ohne die Schaltfläche Exit zu verwenden, bleibt das Programm im Speicher und läuft weiter, und die Anzeige bleibt im "Ausgabefenster". FreeCAD muss beendet werden, um es aus dem Speicher zu löschen.
In der Tabelle sind nur die ersten 200 Elemente des Objekts sichtbar. Enthält das Objekt mehr als 200 Elemente, wird ein Signal durch (! +200) angezeigt. Die vollständige Datenliste ist in der Datei sichtbar, die mit der Schaltfläche Save gespeichert wird.

Wenn das Fenstermakro nach der Ausführung nicht sichtbar ist, siehe das untere Fenster:


Projekt:
lies die Datei direkt in einer Tabelle. done
stimmt mit den "Kanten" und ihren Koordinaten überein done
Zuordnung eines Stoffes zu seiner Dichte
Neigung auf das Element und nicht auf das globale Objekt erledigt
Inlay direkt in der Oberfläche von FreeCAD fertig

Version

ver "1.30c" 2025/01/28 : Verbindende ComboBox in Arch Linux

ersetzt:

QtCore.QObject.connect(self.comboBox_Unit, QtCore.SIGNAL(u"currentIndexChanged(QString)"), self.SIGNAL_comboPoids_Changed)

durch:

self.comboBox_Unit.currentTextChanged.connect(self.SIGNAL_comboPoids_Changed)

ver "1.30b" 2025/01/20 : den Windows-Schrägstrich ersetzen "\" durch den Python-Schrägstrich "/"

ver "1.30" 2025/01/02 : Alle Referenzen zu PySide, PySide2 und QtWidgets gelöscht, den (Qt) Datei-Speichern-Dialog angepasst

#
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 *

            OpenName, Filter = PySide2.QtWidgets.QFileDialog.getOpenFileName(None, u"Read a txt file", setPathLatestDirectory, "*.FCInfo *.csv *.asc *.txt;;FCInfo (*.FCInfo);;Cvs (*.csv);;Ascii (*.asc);;TXT (*.txt);;(*.*);;(*)")#PySide2

ersetzt durch und Befehl ausgetauscht durch

#
import PySide
try:
    from PySide import QtWidgets
    from PySide.QtWidgets import *
except Exception:
    None
from PySide import QtGui , QtCore
from PySide.QtGui import *
from PySide.QtCore import *

            OpenName, Filter = QFileDialog.getOpenFileName(None, u"Read a txt file", setPathLatestDirectory, "*.FCInfo *.csv *.asc *.txt;;FCInfo (*.FCInfo);;Cvs (*.csv);;Ascii (*.asc);;TXT (*.txt);;(*.*);;(*)")#PySide

ver "1.29b" 2024/05/10 PySide2 modify Inertia " MatrixX1*uniteM to (MatrixX1*uniteM) " and adding spinBox inertia

ver 1.29 2024/05/06 french version fr PySide6 by sylvainbx https://gist.github.com/sylvainbx/af09a30be3e1427de56305825331fb29 merci sylvainbx

ver 1.28b 1.28c 2023/10/30 Rechtschreibung

ver 1.28 01/09/2023 Variablennamen ändern, Möglichkeit, jeden Sektor auszublenden, Daten-Tabelle im Dokument speichern, Oberflächenradius, Schaltfläche webWiki und webForum hinzufügen

ver 1.27 2023/06/30 Das Stylesheet optimiert, die Position links/rechts korrigiert und die Ansicht nach der Bearbeitung in Sketcher wieder herstellen

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

ersetzt durch

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

Adding

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

How do i exit from FreeCAD instead of Python?

instead:

self.window.hide()

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

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

Verweise

Siehe auch: Arch Survey Arch Inspizieren

Sie können Ihre Kommentare im Forum teilen Info Workbench - Help with icons please.
Hier noch ein Beitrag von FCInfo Macro