Let's talk about libredwg support

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!
L_K
Posts: 2
Joined: Sun Nov 15, 2020 7:56 pm

Re: Let's talk about libredwg support

Post by L_K »

Hi,
tanks for all the work and effort you are putting in that project!
I'm relatively new to FreeCAD and just tried to install libredwg as described on the wiki page.
make is throwing this

Code: Select all

~/libredwg/build$ make
make: *** No targets specified and no makefile found.  Stop.
digging into it I found "Determining if the include file pcre2.h exists failed" in an error log.
I didn't found a straight way how to resolve that. Dose anyone know what I'm missing?
I'm running linux mint
antonioferrinho
Posts: 2
Joined: Tue Feb 16, 2021 4:29 pm

Re: Let's talk about libredwg support

Post by antonioferrinho »

Hi all, thanks for all this effort. I am new to FreeCAD and to Linux (using for 1 year now). I recently updated my system to Linux Mint MATE 20.3.

I am trying to open a .DWG file (cannot share it due to property rights) and after going around the ODAFileConverter and 0.18 version of FreeCAD, I installed the daily version.

OS: Linux Mint 20.1 (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 070b5560d0cb244e9b142e7d76137ecfae3cf198
Python version: 3.8.5
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)

So I tried to open the .dwg directly without changing anything on FreeCAD, and by default the ODAFileConverter (which is installed) couldn't do it, I was getting the error of the Qt_5.14 version not installed, as mentioned in this thread. I installed the 5.14.1 version of Qt, changed the version of Qt to be used, according to this thread and I receive the following info when using the

Code: Select all

$ qmake -v
QMake version 3.1
Using Qt version 5.14.1 in /opt/Qt/5.14.1/gcc_64/lib
But the error from ODAFileConverter keeps displaying running it outside of FreeCAD:

Code: Select all

/usr/bin/ODAFileConverter_21.11.0.0/ODAFileConverter: /lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.14' not found (required by /usr/bin/ODAFileConverter_21.11.0.0/ODAFileConverter)
So I quit this idea and went to libredwg. Downloaded and compile the tar.gz from libredwg webpage (version 12.1) following the instructions.

I removed the path to ODAFileConverter on the Preferences of FreeCAD, to leave just the option for libredwg, I believe.

When I open the .dwg, now it opens a window as if the document was imported and opened, but nothing shows on the board.

I get the following error on the report view:

Code: Select all

18:54:55  Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/share/freecad-daily/Mod/Draft/importDWG.py", line 80, in open
    doc = importDXF.open(dxf)
  File "/usr/share/freecad-daily/Mod/Draft/importDXF.py", line 2795, in open
    Import.readDXF(filename)
<class 'RuntimeError'>: File doesn't exist
On the python console, I get the following:

Code: Select all

>>> import importDWG
>>> importDWG.open(u"/media/antonioferrinho/8E28B77C28B761BF/01.Diversos/Spirala/Spirala Community Home files/SITE CAD & PDF PLAN/Spirala SITE CAD.dwg")
>>> # App.setActiveDocument("Spirala_SITE_CAD")
>>> # App.ActiveDocument=App.getDocument("Spirala_SITE_CAD")
>>> # Gui.ActiveDocument=Gui.getDocument("Spirala_SITE_CAD")
>>> ### End command Std_Open
Any thoughts that might help here?

P.S:writing this post I realised that FreeCAD recognizes Qt version different from the one that is configured. Both of them are installed.
antonioferrinho
Posts: 2
Joined: Tue Feb 16, 2021 4:29 pm

Re: Let's talk about libredwg support

Post by antonioferrinho »

L_K wrote: Wed Jan 27, 2021 4:58 pm Hi,
tanks for all the work and effort you are putting in that project!
I'm relatively new to FreeCAD and just tried to install libredwg as described on the wiki page.
make is throwing this

Code: Select all

~/libredwg/build$ make
make: *** No targets specified and no makefile found.  Stop.
digging into it I found "Determining if the include file pcre2.h exists failed" in an error log.
I didn't found a straight way how to resolve that. Dose anyone know what I'm missing?
I'm running linux mint
Did you try to use the make command inside the directory created by the extraction? Following these instructions? It worked perfectly for me in Mint
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Let's talk about libredwg support

Post by Roy_043 »

looo wrote: Sat Feb 29, 2020 8:36 am Currently we ship libredwg with the appimage and dmg (0.19_pre).
This may need to be looked at for version V0.20. I see there is a DLL included in the Widows appimages (libredwg-0.dll), but AFAICT the import and export utility now looks for dxf2dwg.exe and dwg2dxf.exe, which are missing.

See: https://github.com/FreeCAD/FreeCAD/blob ... WG.py#L206
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Let's talk about libredwg support

Post by yorik »

Roy_043 wrote: Wed Oct 20, 2021 11:20 am AFAICT the import and export utility now looks for dxf2dwg.exe and dwg2dxf.exe, which are missing.
Indeed. I don't think the dll is used anywhere else... But I seem to recall libredwg had python bindings, that we could use somehow. Beware of the license problems, though. We cannot have FreeCAD depend on libredwg
Post Reply