Macro FCInfo/ru

Описание
Предоставляет информацию о выбранной форме и может отображать преобразование длины, наклона (градусы, радианы, уклоны, процент), площади, объёма и веса в различных единицах (метрических и британских). Теперь макрос также работает для элементов эскиза в режиме редактирования.



Использование
Выберите объект или запустите приложение и выберите объект, после чего появится ряд сведений. Его расчеты основаны на единице измерения FreeCAD, которой является мм при каждом новом выделении, единица длины всегда указывается в мм, а угол - в десятичных градусах.

Сектор 1: Документ
 * Название документа
 * Метка объекта
 * Внутреннее имя объекта
 * Имя субэлемента объекта
 * Тип объекта

Sector 1: Document



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

 Сектор 2: Координаты щелкают мышью
 * Координаты X, Y и Z щелкают мышью
 * Кнопка создания в точке, оси, плоскости, копировать векторную ось формы FreeCAD.Vector (-24.0, 240.0, 7.0)




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

Sector 3: Color on point


Сектор 3: Ценность
 * Длина объекта, если объект отображается по периметру лица, можно выбрать размер единицы измерения: km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique. Если объект является кругом, то одна секунда lineEdit открыта и отображает радиус круга.
 * Периметр формы

Sector 4: Units


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

Sector 5: Inclination



 * Inclination of the object can be displayed in:
 * decimal degree, ex:
 * degree minute seconde, ex:
 * radian, ex:
 * grade, ex:
 * pourcent, ex: 30° =
 * Inclinations in planes XY, YZ, ZX and their coordinates
 * Direction object, give the direction of object. The calculate is : coord_1 - coord_2 = direction (or reverse)
 * this button create a line in direction of the object.
 * ValueAt(0), returns the 3D vector corresponding to a parameter value.
 * this button create a line in ValueAt direction of the object.
 * NormalAt(0,0), returns the 3D vector corresponding to a parameter value.
 * this button create a line in NormalAt direction of the object.

Sector 6: Surface and Volume


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.
 * Surface of the form displayed, unit size can be selected.
 * Surface of the face displayed, unit size can be selected.
 * Volume of the form displayed, unit size can be selected.
 * Unit, choice your unit.
 * The unit mass can be chosen :
 * Weight of the form displayed, unit mass can be selected.
 * Density of the material in kg by dm3
 * Material
 * 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
 * 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 the field displayed
 * : save the modification or the new material

Sector 7: Cost



 * Cost total : cost total of the object selected


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

Sector 8: BoundBox



 * BoundBox gives extreme dimensions of the shape.
 * maximum X length :
 * maximum Y length :
 * maximum Z length :
 * diagonal length :
 * : create 6 rectangles to dimensions of boundbox
 * : create volume to dimensions of boundbox
 * : create the dimension of the triangle (boundbox)
 * If the is checked, the spinbox dimension of text  is operational for give your value (3.0 by default)

Sector 9: Center of:



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

Sector 10: Inertia


same for length and weigth
 * 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 :, , ,
 * action line 2 :, , ,
 * action line 3 :, , ,
 * action 4 diagonal :, ,
 * Determinant 1 :  computes the determinant of the matrix, in scientific value
 * Determinant 2 :  computes the determinant of the matrix, in decimal value

Sector 11: Vertexes and details


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 button in a file in CSV format and can be viewed the file in spreadsheet with the  or by an external spreadsheet as LibreOffice OpenOffice or other)
 * 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)

Sector 12: SpreadSheet



 * : read the data in a spreadsheet saved .FCInfo or txt, asc, csv
 * : save the data in disk in the form selected below .FCInfo or txt, asc, csv
 * : the separator is Tabulation (by default)
 * : the separator is Comma
 * : the separator is Semicolon
 * : the separator is Space

Возможность сохранить или прочитать электронную таблицу с другим разделителем, табуляцией, запятой, точкой с запятой, пробелом

Табуляция является разделителем для модуля электронных таблиц FreeCAD.

Число этих четырех разделителей рассчитывается для справки, если неизвестно

COMMA - это старый (01.16 и ранее) разделитель макроса FCInfo

Теперь для совместимости с таблицей FreeCAD и начиная с версии 01.17 TABULATION является разделителем по умолчанию.

Если вы хотите преобразовать свою старую электронную таблицу FCInfo: откройте ее в FCInfo и сохраните ее, выбрав опцию Tabulation

Sector 13: Main



 * : if this CheckBox is checked, the informations are displayed in the report view window
 * : if checked, one point is created in the coordinate displayed form : FreeCAD.Vector(-24.0, 240.0, 7.0)
 * : if checked, one axis is created in the coordinate displayed form : FreeCAD.Vector(-24.0, 240.0, 7.0)
 * : if checked, one axis plane is created in the coordinate displayed form : FreeCAD.Vector(-24.0, 240.0, 7.0)
 * : None clipBoard
 * : If checked the coordinate are copy in the clipBoard Form : FreeCAD.Vector(X.0, Y.0, Z.0) FreeCAD model
 * : If checked the coordinate are copy in the clipBoard Form : X, Y, Z with Comma separator
 * : If checked the coordinate are copy in the clipBoard Form : X Y Z as is with Space separator
 * : 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.
 * : give the number of decimal displayed
 * : give the dimensionof text in the macro
 * : refresh the display of data in report view
 * : exit properly the macro

После запуска макроса макрос остается активным, а окно остается видимым. Чтобы выйти из макроса, нажмите. Если вы уйдете крестиком, макрос останется в памяти, а данные появятся в "представлении отчета" FreeCAD.

Options


Единица длины:
km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.

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

Угол градусов :

 * 1) decimal degree, ex: 174.831872611°
 * 2) degree minute seconde, ex: 174° 49' 54.741401''
 * 3) radian, ex: 3.05139181449 rad
 * 4) grade, ex: 194.257636235 gon
 * 5) pourcent ex: 30° = 57.74%

Понимание углов в дисплее FCInfo.

Единица измерения веса :
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

the "spinBox" is set to 7,5 kg, средняя плотность стали. Если вы хотите другое значение по умолчанию, измените значение плотности, линии 208

FCInfo Configuration

 * Location : Tools > Edit parameter > *User parameter:BaseApp/Preferences/Macros/FCMmacros/FCInfo/
 * switchNotInfoOnBeginning  # SetBool  or []
 * Display or not this text information on run macro
 * [] = display this information
 * = this Information is Not displayed On Beginning
 * switchVersionSearch       # SetBool  or []
 * Search if one new version exist on run macro
 * switchWarning             # SetBool  or []
 * Display or not display the window warning in case not good selection
 * switchCreatePoint         # SetBool  or []
 * Check the Create point checkBox
 * switchCreateAxis          # SetBool  or []
 * Check the Create axis checkBox
 * switchCreatePlane         # SetBool  or []
 * Check the Create plane checkBox
 * switchDisplayInfoObject   # SetBool  or []
 * Check the info checkBox
 * switchClearDisplayReportView # SetBool or []
 * if switchClearDisplayReportView is the ReportView is cleared
 * seTWidgetPosition         # SetBool  or []
 * Check the Widget Position Left/Right checkBox
 * if seTWidgetPosition [] : if seTPositionFlyRightLeft = 2 = docked to Right
 * if seTWidgetPosition    : if seTPositionFlyRightLeft = 3 = docked to Left
 * if it is 1 the window macro is not docked
 * switchBoundBoxCreateText  # SetBool  or []
 * 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   or []
 * Display the axis of the circles (arcs) for create the BSpline
 * switchBSplineCreateCircleConstructor     #SetBool   or []
 * Display the circles cretors for create the BSpline
 * switchCreateLineDiVatNatOnClick          #SetBool   or []
 * Create the Line info on point (0,0,0) or on point mouse clicked (x,y,z) if it is
 * If it is one '*' is displayed in front of text. EX: '*Direction'

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

All calculations are done without taking account of this option


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

скрипт
Скопируйте содержимое макроса в файл с именем "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 ".

Или прямо в интерфейсе FreeCAD

Значок должен находиться в том же каталоге, что и макрос.

Загрузите расположение изображения на иконке   а затем перетащите мышкой правой кнопкой мыши «сохранить как» (не меняйте название)

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: слишком долго, чтобы содержаться на вики-странице (в настоящее время вики-страницы принимают только 64 КБ), код макроса размещен на форуме

Загрузите файл макроса в gist docked to right

(Или На форуме.)

PS: этот макрос использует getSelection , и список объектов начинается с 1 ex: для блока Edge1 to Edge12 и код в консоли начинается с 0 ex: для поля Edge [0] to Edge[11]

Это нормально, когда подсчет массивов/списков внутри OpenCascade всегда начинается с 1, а не с 0

Ограничения
Всегда оставляйте кнопку. Если выйти из программы, не нажимая кнопку, программа останется в памяти и продолжит работу, а дисплей останется в «отчете о просмотре». Вы должны оставить FreeCAD, чтобы стереть его из памяти.

В таблице видны только первые 200 элементов объекта, если в объекте более 200 элементов, сигнал будет отображаться как (! +200). Полный список данных отображается в файле, сохраненном кнопкой.

Если макрос окна не виден после запуска, см. Нижнее окно:





проект:

читает файл прямо в таблице. готово

соответствует "краям" и их координатам выполнено

Ассоциация вещества по его плотности

наклон элемента, а не глобального объекта готово

вставка прямо в интерфейс FreeCAD выполнена

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

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

replaced by


 * ver 1.22, 12/11/2020 : now the macro is totally uninstalled i use :


 * ver 1.26b 20/02/2022 upgrade for detect BSpline in SubObject


 * ver 1.26 06/02/2022 add info on Mesh and Points objects, decode colours, duplicate object or subObject, memorize the latest path and other preferences options

Adding
 * 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")" ??


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

How do i exit from FreeCAD instead of Python?

instead:

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


 * ver 1.21-3.01, 07/11/2019 # 07/11/2019 ver "01.21-3-rmu" replace character micro = "U", square = "2", cube = "3", degrees = " deg" see "https://forum.freecadweb.org/viewtopic.php?f=3&t=6005&start=70#p345819"
 * ver 1.21.01 (1.21-rmu) 30/05/2019 rmu change fixed positions to qt layouts grid.addWidget by rmu75 see the rmu75 fork "https://gist.github.com/rmu75/b165147bd1c2f2659c014103793ae1d8"
 * ver 1.20, 29/01/2018 optimization
 * ver 1.19, 20/01/2018 create checkBox for use detection all elements of the object if wanted or not , the macro is faster. Optimisation
 * ver 1.18, 19/12/2017 ...
 * ver 1.17c, 14/12/2017 create plane with coordinate give in one project in other project and replace "FCInfo" by "__title__"
 * ver 1.17b, 13/12/2017 little correction replace FCTreeView to FCInfo
 * ver 1.17, 12/12/2017 add upgrade Moment of inertia mm and kg by pinq FCMacro and moment of inertia of assembly, and create plane, axis, point, and add options separator for spreadsheet
 * ver 1.16, 21/06/2017 add control height police (here PointSize 8) and checkbox for position the window to right or left


 * ver 1.15, 19/12/2015 suppression PyQt4 option see , add checkBox for editing infos in report view


 * ver 1.14, 04/08/2014 replace PyQt4 and PySide and correct tooltip not displayed cause on PySide and add fg


 * ver 1.13, 27/07/2014 replace FCInfo_en_Ver_1-12_Docked.FCMacro to FCInfo_en_Ver_1-13_Docked.FCMacro accept PyQt4 and PySide


 * ver 1.12, 10/03/2014 adding tooltip


 * ver 1.11, 04/03/2014 adding µm, nm, pm, fm, µg, ng, pg, pourcent, fixed of grandeur carat "cd" in "ct", display of the label and internal name, fixed calculation of angles XY YZ ZX could give an error on a compound shape,  window dockable in FreeCAD


 * ver 1.10.b, 19/11/2013 buttons outside the scrollbar and the dimensions of the window blocking

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


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

ver 1.09, 04/11/2013 works perfectly on Windows and Linux (cause of errors on Linux the characters : ² ³ ° "ordinal not in range(128)")

In a Linux distribution and in the case of an error of "ordinal not in range (128)" an alternative version exists on this page Macro_FCInfo_Alternate_Linux


 * ver 1.08, 24/10/2013 correction of high top "Faces" and "Edges" displaying 100 objects (in the saved file)


 * ver 1.07, 11/10/2013 matches the "Faces" and their coordinates.


 * ver 1.06, 22/09/2013 matches the "Edges" and their coordinates, inclination on the element rather than the global object


 * ver 1.05, 17/09/2013 added an icon for the spreadsheet, conversion barrel fr, affichage des dimensions overall instead of coordinates.


 * ver 1.04, 11/09/2013: read the file directly in a table.


 * ver 1.03, 09/09/2013: clearer display in view report and replacement by "typeObject = sel[0].Shape.ShapeType"


 * ver 1.02, 7/09/2013 : small updates


 * ver 1.00, 6/09/2013

Ссылки
Смотрите также: Arch Survey

Вы можете поделиться своими комментариями на форуме Info Workbench - Help with icons please.

Здесь еще один пост FCInfo Macro