LibreCAD / LibreCAD

LibreCAD is a cross-platform 2D CAD program written in C++17. It can read DXF/DWG files and can write DXF/PDF/SVG files. It supports point/line/circle/ellipse/parabola/spline primitives. The user interface is highly customizable, and has dozens of translations.
http://librecad.org/
Other
4.48k stars 1.01k forks source link

dwg sample wanted!!! #1143

Closed humfrey28whu closed 5 years ago

humfrey28whu commented 5 years ago

Expected behavior

I want to read a dwg file by using libdxfrw.pro. However, I don't know which function or class to choose. I need to change this dwg file to another coordinate system. Could you please write a piece of sample code for me, to visit the elements like points and lines in the dwg file? Thank you!

lordofbikes commented 5 years ago

There is already an example in the library repo: https://github.com/LibreCAD/libdxfrw/tree/master/dwg2dxf DWG support in libdxfrw is very rudimentary, it still often fails to read DWG files. And there is no write support for DWG, only for DXF. There are some more complete DWG libraries than libdxfrw out there, with write support too. DWG is a proprietary format and has still a bunch of secrets. There is no public documentation available, all information is nonofficial and only from re-engineering.