Volume Calculator

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
Post Reply
mafer78
Posts: 56
Joined: Sat Sep 26, 2015 2:12 pm

Volume Calculator

Post by mafer78 »

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
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Volume Calculator

Post by eivindkvedalen »

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
Hi,

You can do this using the spreadsheet workbench, see the documentation examples at http://www.freecadweb.org/wiki/index.ph ... _Workbench

Eivind
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Volume Calculator

Post by renatorivo »

You can use the Macro_FCInfo
if you get an error with PyQt4, change all PyQt4 with PySide.

For other macros see Macros_recipes
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Volume Calculator

Post by jmaustpc »

If it is just one object once then you can type the following into the Python window,

Code: Select all

App.ActiveDocument.Cylinder.Shape.Volume
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
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Volume Calculator

Post by jmaustpc »

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
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Volume Calculator

Post by jmaustpc »

I have experimented some more...clicking survey and then double clicking on an object in the main windows does give you the volume.
mafer78
Posts: 56
Joined: Sat Sep 26, 2015 2:12 pm

Re: Volume Calculator

Post by mafer78 »

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
User avatar
r.tec
Posts: 533
Joined: Thu Oct 23, 2014 4:06 pm
Location: Bad Münstereifel, NRW, Germany
Contact:

Re: Volume Calculator

Post by r.tec »

mafer78 wrote: Could you know if exist a script/function for retrieve the weight of my part ?
//Mafer
....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.
weasel_face
Posts: 45
Joined: Tue Aug 09, 2016 2:56 pm
Location: Boituva/SP - Brasil
Contact:

Re: Volume Calculator

Post by weasel_face »

jmaustpc 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,

Code: Select all

App.ActiveDocument.Cylinder.Shape.Volume
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
The best Tip
weasel_face : Marco Silveira
Post Reply