Macro FCInfo

FCInfo.png Macro FCInfo

Description
Gives a series of information on the form.
Author
Mario52
Links
Macros recipes
How to install macros
How to customize toolbars
Version
1.20
Date last modification
29/01/2018


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.


FCInfo

Utilisation

Select an object or launch the application and select an object, and a series of informations appear. His calculations based on unity of FreeCAD, which is the mm to each new selection, the length unit always comes back on mm and angle on decimal degrees.

upper window
lower window

Sector 1: Document

Sector 2: Coordinates click mouse

Sector 3: Value

Sector 4: Vertexes and details

Sector 5: Inclination

Sector 6: Surface and Volume

Sector 7: BoundBox

Sector 8: Center of:

Sector 9: Inertia

same for length and weigth

Section 10: SpreadSheet

Option for save or read the spreadSheet with different separator, Tabulation, Comma, Semicolon, Space
The Tabulation are the separator for the FreeCAD spreadSheet module
The number of this four separator are calculate for help if unknown
The COMMA are the old (01.16 and before) separator of the FCInfo macro
Now for compatibility with the FreeCAD spreadSheet and since 01.17 version the TABULATION is the separator by default
If you want to convert your old FCInfo spreadsheet : Open it in FCInfo and save it with the Tabulation option checked

Section 11: Main

Once launched macro, the macro remains active and the window remains visible. To exit the macro by pressing Exit. If you leave by the cross, the macro remains in memory and the data appears in the "report view" of FreeCAD.


Options

The unit used

Length unit:

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

Angle degrees :
  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%

Understanding of angles in FCInfo display.


Weight unit :

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, average density of steel. If you want a different default value, change the value of the density, line 206

global densite       ; densite       = 7.5  # (steel = 7.5 kg par dm3) 

A file can be created by the button Save. The file is written as a file csv in this way, the data can be studied in a spreadsheet in FreeCAD or Openoffice, LibreOffice...

Script

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

Or, directly in the interface of FreeCAD
The icon must be in the same directory as the macro.
Download image positioning on the icon FCInfo.png FCInfoSpreadsheet.png and then drag the mouse right click "save as" (do not change the name)
PS: too long to be contained in the wiki page (for the time being the wiki pages accept only 64 KB) the macro code has been placed in the forum

There is also FCInfo_Alternate_Linux for only for FreeCAD version 0.13... and PyQt4

There is also a Macro_FCInfo_Alternate_Linux here the code is changed (due to the character display error : ² ³ ° μ ordinal not in range (128)") which posed problems in certain configurations the functions are the same
Example :

global uniteSs       ; uniteSs       = u"mm²"
global uniteVs       ; uniteVs       = u"mm³"
global uniteAs       ; uniteAs       = u"°" 

remplacés par

global uniteSs       ; uniteSs       = "mm"+iso8859(unichr(178))
global uniteVs       ; uniteVs       = "mm"+iso8859(unichr(179))
global uniteAs       ; uniteAs       = iso8859(unichr(176)) 

Files saved with this version is incompatible with the other version (docked or not)


Download the icon file Macro_FCInfo_Icon unzip and copy the icon in the same directory of the macro

Dwnload the macro file on gist docked to right


(Or On the forum. )

PS: this macro uses getSelection() and the list of object begin to 1 ex: for a box Edge1 to Edge12 and the code in the console start at 0 ex: for a box Edge[0] to Edge[11]
This is normal the counting on arrays/lists inside OpenCascade always starts at 1 and not at 0

Limitations

Always leave the button Exit. If one exits the program without going through the button Exit the program remains in memory and continues to run and the display will remain in the "view report". You must leave FreeCAD to erase it from memory.
Only the first 200 elements of the object 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 file saved by the button Save.

If the window macro is invisible after the run , see the bottom window :

Macro FCInfo 08.png


FCInfo begin 00.gif


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

currently:

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

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

Links

You can share your comments on the forum Info Workbench - Help with icons please.
Here another post of FCInfo Macro

Online version: "http://www.freecadweb.org/wiki/index.php?title=Macro_FCInfo&oldid=246618"

Navigation menu