LibreOffice with Python 3.5

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: LibreOffice with Python 3.5

Post by dprojects »

Kunda1 wrote: Sat Feb 06, 2021 1:25 pm did you update?
Yes. I have tested under Windows 8.1 and new Ubuntu as well. This is always the same. It works for you? maybe I am doing something wrong?

OS: Ubuntu 20.10 (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23756 (Git) AppImage
Build type: Release
Branch: master
Hash:
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

Same issue with direct spreadsheet save to pdf: "Printing not implemented for SpreadsheetGui::SheetView"

EDIT: What I am trying to do:
1) open FreeCAD
2) create spreadsheet, ad example data
3) set view (selection to Spreadsheet)
4) choose from manu: File -> Export...
5) choose .pdf file type
6) nothing happens, end up with console error, no file

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: LibreOffice with Python 3.5

Post by jmaustpc »

dprojects wrote: Sat Feb 06, 2021 1:35 pm set view (selection to Spreadsheet)
4) choose from manu: File -> Export...
5) choose .pdf file type
6) nothing happens, end up with console error, no
Why would you do that. No wonder you are getting a result. Go to the TechDraw WB and look at the tool bar icons, there is one there to print the drawing.

Did you download the demo files I posted on page 3 of this topic? The results are not perfect, compare the pdf and the techdrawing to see difference.

You can change cell size in spreadsheet wb.
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: LibreOffice with Python 3.5

Post by dprojects »

jmaustpc wrote: Sat Feb 06, 2021 2:51 pm Why would you do that. No wonder you are getting a result.
Why not? Why not allow convert spreadsheet to LibreOffice Writer document as a table? This would be very powerful solution. You would be able to change anything in fact there, any kind of color and formatting. Cover all the things directly in TechDraw does not make any sense. To much code, implement LibreOffice in FreeCAD as option is too much and not worth it. Better just store spreadsheet data as a open free format but not CVS because it not preserve the formattting.
jmaustpc wrote: Sat Feb 06, 2021 2:51 pm Go to the TechDraw WB and look at the tool bar icons, there is one there to print the drawing.
This is helpful solution. It wasn't available when I was opening the issue https://tracker.freecadweb.org/view.php?id=2957
But TechDraw has its own formatting style. You have logo and spreadsheet is placed in the center by default without text adjustment.
This is readable but not look like the python macro output in the spreadsheet.
jmaustpc wrote: Sat Feb 06, 2021 2:51 pm Did you download the demo files I posted on page 3 of this topic? The results are not perfect, compare the pdf and the techdrawing to see difference.
No. Sorry.
jmaustpc wrote: Sat Feb 06, 2021 2:51 pm You can change cell size in spreadsheet wb.
But in TechDraw looks like they are resized. TechDraw is good feature but it is the way to implement LibreOffice Writer directly in FreeCAD. This is wasting time in my opinion. If you save spreadsheet as file in open format, you can do what you like without waiting on TechDraw implementation.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: LibreOffice with Python 3.5

Post by chennes »

dprojects wrote: Sat Feb 06, 2021 6:33 pm the way to implement LibreOffice Writer directly in FreeCAD.
I think that's a reasonable feature request: the export and import of ODS files would be a nice thing to implement in Spreadsheet. I don't see any mention of it in the tracker, so I think you are clear to submit it as a feature request. We are in a feature freeze at the moment pending the 0.19 release, but maybe there is a dev out there who would be interested in taking on the project for a later release. Or maybe you are yourself a dev, looking for a side project? ;)
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: LibreOffice with Python 3.5

Post by dprojects »

chennes wrote: Sat Feb 06, 2021 7:09 pm I think that's a reasonable feature request: the export and import of ODS files would be a nice thing to implement in Spreadsheet. I don't see any mention of it in the tracker, so I think you are clear to submit it as a feature request.
So here it is: https://tracker.freecadweb.org/view.php?id=4556
chennes wrote: Sat Feb 06, 2021 7:09 pm We are in a feature freeze at the moment pending the 0.19 release, but maybe there is a dev out there who would be interested in taking on the project for a later release. Or maybe you are yourself a dev, looking for a side project? ;)
I don't have so much professional experience and I am not so familiar with FreeCAD code as you probably are. For sure here are many better and more advanced developers than I am.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: LibreOffice with Python 3.5

Post by Kunda1 »

Enhanced Uno Object inspector for libreoffice 7.2 https://tomazvajngerl.blogspot.com/2021 ... ector.html
This means better scripting
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: LibreOffice with Python 3.5

Post by heda »

meanwhile made this Macro_Spreadsheet2html, by far not perfect, but better than csv.
have only done some basic test runs, so might break on use.
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: LibreOffice with Python 3.5

Post by heda »

well that was a bit disappointing...

for some reason which I do not understand the install of the macro is broken, did of course not test it yesterday since all looked ok, but it seems like the wiki does not render all of the code in the macro, and using addon manager it only takes what is rendered.

if one goes into "view source" on the wiki, the full code is there, and that could be copied for a manual install.
or just take the file from here.

anyone having a clue of what is going on?
the rendering stopped at a '|', so then I replaced that with chr(124) but that did nothing..
there are other macros on the wiki that is longer, so do not see why it should not work.

ps: before someone says git, na thanks, not for me - but if anyone wants to put it out there feel free.
Attachments
Spreadsheet2html.FCMacro
(12.94 KiB) Downloaded 59 times
Last edited by heda on Tue Aug 10, 2021 8:48 pm, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: LibreOffice with Python 3.5

Post by Kunda1 »

heda, i think mario52 found a way around this by adding the wiki macros to gist files?
mario52 wrote: pinged by pinger macro
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: LibreOffice with Python 3.5

Post by mario52 »

Hi
heda wrote: Tue Aug 10, 2021 6:12 pm anyone having a clue of what is going on?
the rendering stopped at a '|', so then I replaced that with chr(124) but that did nothing..
there are other macros on the wiki that is longer, so do not see why it should not work.
corrected i replace "{{Code|code= ... }}" by "<pre> </pre>" cause the pipe "|" include in the file cut the macro code

or

Code: Select all


{{MacroCode|code=   
<nowiki>
 ... code of the macro
</nowiki>
}}

as mentioned Macro_documentation#Adding_the_macro_code
Kunda1 wrote: Tue Aug 10, 2021 6:22 pm
sorry for the late but "mieux vaut tard que jamais"

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply