[QGIS-Developer] Exporting from QGIS to CAD format - is it possible to offer DWG export

Stefan Steiger Steiger at cor-management.ch
Wed Sep 26 05:52:13 PDT 2018


You could use the ODA File-Converter to convert dwg to dxf and vice-versa. 
https://www.opendesign.com/guestfiles/oda_file_converter 

It can also run as batch-process. 
Runs natively on Linux/Mac/Windows, 32&64 Bit.
It's Freeware, AFAIK. 
That way you can guarantee it will always be able to read and write the latest DWGs. 


You can also use the Teigha Online File Converter, which converts .dwg/.dxf files to PDF/BMP.
https://www.opendesign.com/teigha_online_converter 


You cannot currently have a free program that reads and writes DWG on its own. 
DWG is a proprietary file format, on purpose designed to be difficult to understand, and it's encrypted. 
To be able to flawlessly read and write DWGs, you need to reverse-engineer the AutoCAD file format, by reverse-engineering AutoCAD. 
This naturally takes a lot of time, which means there are no Free-Software DWG libraries that implement a sufficiently large subset of the AutoCAD file format. 
There are currently only two software applications that offer a reliable DWG interface. 
One is ODA Teigha for C++/Java/.NET. 
The other is Woutware CADlib.

The problem with ODA-Teigha ist hat it takes royalties for each and every application deployed with Teigha. 
Which would be deadly for a free software project. 

WoutWare is better in this respect, as it requires a one-time license of currently 1'208 USD/year per developer. 
Also, Teigha is a pain in the ass to use. 
The problem with WoutWare is, that you need a new license each time you need to download a new version of WoutWare because there was a new version of AutoCAD. 
Also, WoutWare is .NET and therefore currently only works on Windows. 
There is a preview release of WoutWare for .NET Core (which works on Linux, and presumably on OSX too). 
.NET Core can be self-containedly deployed (Windows, Linux, Mac) , so there are no dependencies on a certain version of the .NET-Framwork. 

Those are the two only (working) options when you deal with DWG. 



-----Ursprüngliche Nachricht-----
Von: QGIS-Developer [mailto:qgis-developer-bounces at lists.osgeo.org] Im Auftrag von Jürgen E. Fischer
Gesendet: Mittwoch, 26. September 2018 14:23
An: qgis-developer at lists.osgeo.org
Betreff: Re: [QGIS-Developer] Exporting from QGIS to CAD format - is it possible to offer DWG export

Hi Rob,

On Tue, 25. Sep 2018 at 13:49:50 -0400, rjwillson at gmail.com wrote:
> Is there a proprietary licensing reason that QGIS cannot export 
> directly to *.dwg file format rather than only to the dxf format?

We could probably also use libdxfrw, that we use for our import, to write DWG.

But contentwise DXF and DWG are alike - and there's more software that can read DXF than DWG.  
Is using DXF not an option?  
Do you require a certain version of DWG (the format changed quite a bit, although the content actually didn't that much).



Jürgen

-- 
Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31
Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50
Software Engineer           D-26506 Norden             http://www.norbit.de
QGIS release manager (PSC)  Germany                    IRC: jef on FreeNode


More information about the QGIS-Developer mailing list