FreeCAD Memo

How to calculate a volume, surface area and gravity center of a shape

Version 0.13
  1. Select [View]-[Views]-[Python console] in menu bar to display [Python console].
  2. If you enter following commands, each value is displayed in the [Python console].
    • If you want to calculate a surface area : App.ActiveDocument.getObject("Your object name").Shape.Area
    • If you want to calculate a volume : App.ActiveDocument.getObject("Your object name").Shape.Volume
    • If you want to calculate a gravity center : App.ActiveDocument.getObject("Your object name").Shape.CenterOfMass
  3. Note : If shape's ShapeType is "Compound", a gravity center cannot be calculated with the method previously described. To check shape's ShapeType, execute following command.
    • App.ActiveDocument.getObject("Your object name").Shape.ShapeType
Python console File Export dialog
References :