This module adds a new workbench with currently only one command, to create a new spreadsheet object in the document. That spreadsheet object can then be edited by entering editmode (I still couldn't find out why but double-clicking the object in the tree doesn't work at the moment, one must use menu Edit->Toggle edit mode).
In edit mode, a spreadsheet editor window opens, allowing you to change values of the cells. Changes are saved on the fly, so you can simply close the editor when finished. Currently the maximum size of the spreadsheet is limited to what you see in the editor (26 columns x 30 rows). What can be inserted into the cells (either by double-clicking them or by using the edit line above) are text strings, numbers or formulas.
Formulas must begin with a "=" character, and can be things like this:
Code: Select all
=a2*4 =( b4 * b5 ) + 5 = sin(c5) +4
The spreadsheet object is also designed to be used as a full python object, without existence in the FreeCAD document. You can use it like this:
Code: Select all
>>> import Spreadsheet >>> s=Spreadsheet.Spreadsheet() >>> s Spreadsheet object containing 0 cells >>> s.a1 = "Hello, World!" Setting key a1 to value Hello, World! >>> s.a1 'Hello, World!' >>> s Spreadsheet object containing 1 cells >>> s.a2 = "=4*4" Setting key a2 to value =4*4 >>> s.a2 16 >>> s.b1 = 45 Setting key b1 to value 45 >>> s.b1 45 >>> s Spreadsheet object containing 3 cells
Next things I pretend to do:
- Allow to use object properties in formulas (for example "=Objects.MyCube.Length")
- Create a new "Spreadsheet Controller" object, that can be inserted as a child in a Spreadsheet object, and that controls the contents of a series of cells. For example, it could gather the Volume property of all objects in the scene
- Import and export to some easy, basic formats (csv to start with, maybe others)