Volume Calculator
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Volume Calculator
Hi,
could someone knows if there is a function/script that can calculate the volume of the part and/or parts created in freecad?
//mafer
could someone knows if there is a function/script that can calculate the volume of the part and/or parts created in freecad?
//mafer
-
- Posts: 602
- Joined: Tue Jan 29, 2013 10:35 pm
Re: Volume Calculator
Hi,mafer78 wrote:Hi,
could someone knows if there is a function/script that can calculate the volume of the part and/or parts created in freecad?
//mafer
You can do this using the spreadsheet workbench, see the documentation examples at http://www.freecadweb.org/wiki/index.ph ... _Workbench
Eivind
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: Volume Calculator
You can use the Macro_FCInfo
if you get an error with PyQt4, change all PyQt4 with PySide.
For other macros see Macros_recipes
if you get an error with PyQt4, change all PyQt4 with PySide.
For other macros see Macros_recipes
Re: Volume Calculator
If it is just one object once then you can type the following into the Python window,
The above assumes your object in named "Cylinder".
Note that this is the "name" not the "label". FreeCAD creates the "name" on object creation and this is not editable, "Label" is initially on creation by default the same as "Name" in most cases (an exception is "Cube" which is named "Box" so in Python "Cube" would be referenced as "Box").
So if you type the above and press enter, your answer will be displayed ...note that the units are cubic mm, because the base unit for FreeCAD is mm.
To convert to CC just divide by 1000, to convert to L divide by another 1000, etc.
Jim
Code: Select all
App.ActiveDocument.Cylinder.Shape.Volume
Note that this is the "name" not the "label". FreeCAD creates the "name" on object creation and this is not editable, "Label" is initially on creation by default the same as "Name" in most cases (an exception is "Cube" which is named "Box" so in Python "Cube" would be referenced as "Box").
So if you type the above and press enter, your answer will be displayed ...note that the units are cubic mm, because the base unit for FreeCAD is mm.
To convert to CC just divide by 1000, to convert to L divide by another 1000, etc.
Jim
Re: Volume Calculator
You can also go to the Arch workbench and use the Survey tool. I didn't at first mention this because I thought it was not working but it does once you work out how to use it....
Arch_Survey
It seems that you have to click on survey, then click on the object in the main window, tree selection does not seem to work, nor does the tool take the then current selection as input on initialisation.
However to get volume I found you can click on Survey then use box select on your object...hold the shift key and then press "b", then drage a box around your object in the main window and you will get the volume.
Jim
OS: Ubuntu 14.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5924 (Git)
Build type: Release
Branch: master
Hash: 629a89218d72d035fde6161eb6247b4bc0f0651d
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Arch_Survey
It seems that you have to click on survey, then click on the object in the main window, tree selection does not seem to work, nor does the tool take the then current selection as input on initialisation.
However to get volume I found you can click on Survey then use box select on your object...hold the shift key and then press "b", then drage a box around your object in the main window and you will get the volume.
Jim
OS: Ubuntu 14.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5924 (Git)
Build type: Release
Branch: master
Hash: 629a89218d72d035fde6161eb6247b4bc0f0651d
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Re: Volume Calculator
I have experimented some more...clicking survey and then double clicking on an object in the main windows does give you the volume.
Re: Volume Calculator
Many thanks for your great support and feedback.
Could you know if exist a script/function for retrieve the weight of my part ?
I dont' know for example starting from the volume calculator and specifying the specific weight of the material that we have planned to use.
BR
//Mafer
Could you know if exist a script/function for retrieve the weight of my part ?
I dont' know for example starting from the volume calculator and specifying the specific weight of the material that we have planned to use.
BR
//Mafer
Re: Volume Calculator
....Mario's Macro FCInfo does it all for you. You get a table where you can change density of material there and you can even export the table to a speadsheet program. Look at the thread of mass moment of inertia, you can even get this out of this table.mafer78 wrote: Could you know if exist a script/function for retrieve the weight of my part ?
//Mafer
-
- Posts: 45
- Joined: Tue Aug 09, 2016 2:56 pm
- Location: Boituva/SP - Brasil
- Contact:
Re: Volume Calculator
The best Tipjmaustpc wrote: ↑Sun Nov 15, 2015 11:43 pm If it is just one object once then you can type the following into the Python window,
The above assumes your object in named "Cylinder".Code: Select all
App.ActiveDocument.Cylinder.Shape.Volume
Note that this is the "name" not the "label". FreeCAD creates the "name" on object creation and this is not editable, "Label" is initially on creation by default the same as "Name" in most cases (an exception is "Cube" which is named "Box" so in Python "Cube" would be referenced as "Box").
So if you type the above and press enter, your answer will be displayed ...note that the units are cubic mm, because the base unit for FreeCAD is mm.
To convert to CC just divide by 1000, to convert to L divide by another 1000, etc.
Jim
weasel_face : Marco Silveira