Spreadsheet module
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Spreadsheet module
Would it be easier in the long run to embed a "native" spreadsheet object from the underlying platform, like OpenOffice Calc or MS Excel (or I don't know on MacOS)? Sure, it's a platform dependence but an awful lot of work goes into making a robust spreadsheet. Either way, this is very cool! Thanks!
Re: Spreadsheet module
You can already do the work in preferred spreadsheet program and import it in FreeCAD:
viewtopic.php?f=9&t=4359&start=30#p34431
viewtopic.php?f=9&t=4359&start=30#p34431
Re: Spreadsheet module
Ah! Perfect. Thanks!triplus wrote:You can already do the work in preferred spreadsheet program and import it in FreeCAD:
viewtopic.php?f=9&t=4359&start=30#p34431
Re: Spreadsheet module
You're welcome.
Re: Spreadsheet module
Hi,
Could you check my file? Spreadsheet workbench crashes when I'm trying open it.
Next thing: When I'm trying read Shape.Solids[0].CenterOfMass.z it gives me a number in the Python console, but not when I'm using the CellController. I see "Compound object at xxxxxx" instead.
Could you check my file? Spreadsheet workbench crashes when I'm trying open it.
Code: Select all
Traceback (most recent call last):
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
Code: Select all
OS: Ubuntu 14.04 LTS
Platform: 64-bit
Version: 0.14.3639 (Git)
Branch: master
Hash: 4c48bdf2166f273e60bcaf95281b7dde726db2f5
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0
Re: Spreadsheet module
The file opened for me and seems to work in that it shows a crank but I get an error message
Traceback (most recent call last):
File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
<type 'exceptions.ValueError'>: No JSON object could be decoded
OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3641 (Git)
Branch: master
Hash: 2724242f38476a4eab398318783bf7f06f889c05
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.1
Traceback (most recent call last):
File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
<type 'exceptions.ValueError'>: No JSON object could be decoded
OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3641 (Git)
Branch: master
Hash: 2724242f38476a4eab398318783bf7f06f889c05
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.1
Re: Spreadsheet module
Thanks Jim.
It seems that Spreadsheet object is the culprit...
Edit: I found something.
Spreadsheet object in an usual Document.xml file
In my broken file
Notice blank "Python value".
It seems that Spreadsheet object is the culprit...
Edit: I found something.
Spreadsheet object in an usual Document.xml file
Code: Select all
<Object name="Spreadsheet">
<Properties Count="3">
<Property name="Controllers" type="App::PropertyLinkList" group="Base" doc="Cell controllers of this object" attr="0" ro="0" hide="0">
<LinkList count="0">
</LinkList>
</Property>
<Property name="Label" type="App::PropertyString">
<String value="Spreadsheet"/>
</Property>
<Property name="Proxy" type="App::PropertyPythonObject">
<Python value="eyJPYmplY3QiOiAiU3ByZWFkc2hlZXQiLCAiVHlwZSI6ICJTcHJlYWRzaGVldCJ9" encoded="yes" module="Spreadsheet" class="Spreadsheet"/>
</Property>
</Properties>
</Object>
Code: Select all
<Object name="Spreadsheet">
<Properties Count="3">
<Property name="Controllers" type="App::PropertyLinkList" group="Base" doc="Cell controllers of this object" attr="0" ro="0" hide="0">
<LinkList count="10">
<Link value="PropertyController"/>
<Link value="PropertyController001"/>
<Link value="PropertyController002"/>
<Link value="PropertyController003"/>
<Link value="PropertyController004"/>
<Link value="PropertyController005"/>
<Link value="PropertyController006"/>
<Link value="CellController"/>
<Link value="CellController001"/>
<Link value="CellController002"/>
</LinkList>
</Property>
<Property name="Label" type="App::PropertyString">
<String value="Spreadsheet"/>
</Property>
<Property name="Proxy" type="App::PropertyPythonObject">
<Python value="" encoded="yes" module="Spreadsheet" class="Spreadsheet"/>
</Property>
</Properties>
</Object>
Re: Spreadsheet module
I finally found a moment to have a look at this... The problem is that a document object is written as a cell contents, and it contains "<" and ">" characters that cuase problems when written to xml... I'll add something to avoid this.
*Edit* done in git commit 1be778a
*Edit* done in git commit 1be778a
Re: Spreadsheet module
Could this be used to update paramters in my Sketch?
I'm thinking of a way to change i.e the height, length or
diameter of contstrains, so my model updates according
to the values I enter in the spreadsheet.
I'm thinking of a way to change i.e the height, length or
diameter of contstrains, so my model updates according
to the values I enter in the spreadsheet.
Dr. Franklin