How much interest is there to integrate LibreOffice into FreeCAD?

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by microelly2 »

It is nice to see how it will work.
There is no hurry for me at the moment, but keep us uptodate.
There is realy an interest to to have this exchange.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by Kunda1 »

Another usecase for this endeavor: issue #2957: 'please add spreadsheet direct printing'
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
User avatar
salp
Posts: 252
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by salp »

**** this only works in linux ***

I updated the fc_libre macro to utilize the open file dialog box.

The macros should:
  • Open a dialog to get the existing calc document
    start the soffice app as a process and listen on port 2002
    open the spreadsheet file
    write to cell A1 and B2
https://github.com/myoldz/FC_LibreOffic ... re.FCMacro

The macro is a little buggy when starting soffice, it behaves differently on the first start.

Thanks
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by Kunda1 »

salp wrote: Fri Mar 20, 2020 12:21 am **** this only works in linux ***
Where and what version of uno should I install?
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
User avatar
salp
Posts: 252
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by salp »

Kunda1,

The dependencies are:
Python v3.x
python3-uno
pyoo

you can install these from the command line:
"sudo apt-get install python3-uno"
"python3 -m pip3 install pyoo"

EDIT:
Almost forgot, I'm assuming you have a recent version of LibreOffice or OpenOffice installed.
Last edited by salp on Fri Mar 20, 2020 11:32 pm, edited 1 time in total.
User avatar
salp
Posts: 252
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by salp »

Updated the code in fc_libre.FCMacro

The new code gets the currently selected freecad object and attempts to iterate its sub elements and writing the content in the spreadsheet (well that's the idea anyway) :)


Note:
There is a 10 to 15 second delay when the code opens the spreadsheet document, looking into it.

Code: Select all

    fileOp = FileIo()
>>    ## delay is here
    fileName = fileOp.openFile()
If anyone knows how to setup a code development environment, please point me in the right direction.
It seems that I cannot debug in traditional IDE because it does not see the FreeCAD code and AFAIK there is no development module built into FreeCAD.

Thanks
Sal
User avatar
salp
Posts: 252
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by salp »

fc_libre.FCMacro

dependencies
Linux OS
python3-uno
pyoo
LibreOffice or OpenOffice

Well were making some progress:

Changed how soffice process is started, to make sure we are connecting to the correct process.
  • the code checks if the process is already running
    if the process is running it is shutdown
    a new soffice process is started connected to port 2002
This eliminated the pause experienced when executing the macro.

What it can do sofar:
  • starts the soffice process set to listen on port 2002
    opens libreOffice file dilaog window and waits for file selection
    attaches to "Sheet1"
    Writes text to the cell "A1"
    gets the freecad active document info
    write the active file info to the spreasheet.

Next steps
  • Iterate the current object and copy its data to the spreadsheet
    * I'm learning both Python anf FreeCAD scripting at the same time, so this will move slowly
    * Any scripting tips are appreciated


OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
zohozer
Posts: 119
Joined: Mon Jul 28, 2014 8:35 pm

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by zohozer »

Nice to see some progress with this project. When you have a Windows and MacOS working version please let-me know.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by Kunda1 »

salp wrote: Sun Mar 22, 2020 1:47 am What it can do sofar:
  • starts the soffice process set to listen on port 2002
    opens libreOffice file dilaog window and waits for file selection
    attaches to "Sheet1"
    Writes text to the cell "A1"
    gets the freecad active document info
    write the active file info to the spreasheet.
Nice, do you mind adding a screencast of the progress when you post? It really helps to see it visually and it definitely generates more interest
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
User avatar
salp
Posts: 252
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: How much interest is there to integrate LibreOffice into FreeCAD?

Post by salp »

I've not done that before, but I'll give it a try.
I uploaded a video to youtube.

phpBB [video]
Last edited by salp on Sun Mar 22, 2020 10:55 pm, edited 1 time in total.
Post Reply