cad2svg is a simple Linux command-line utility that automatically converts AutoCAD files (both dwg and dxf) to SVG. This utility works and has been tested on Linux (RedHat 8, 9 and FC1, FC2, FC3, FC4). It should work on most x86 Linux distribution without change, and it would certainly not take too much to adapt it to Windows. CapabilitiesSince this is a command-line utility, it is perfect for batch jobs. Capabilities:
LimitationsBefore you decide if this utility is right for you, note the following limitations:
Please bear in mind that this utility is only meant to produce a preview of AutoCAD files. Do not depend on its output to be accurate enough to replace the original drawing in a decision process! If you need a converter that does a better job, there is a commercial software available (no affiliation to me and I have not tested it): http://www.savagesoftware.com/ ExampleThis example is a converted test dwg file of 229KB converted to a 70KB compressed SVG (236KB uncompressed).
To view this svg file you will need Firefox or use a free Adobe or Corel plug-in. Why?I needed a way to display AutoCAD files (both dwg and dxf files) on our intranet. This utility is part of a larger drawing management system that collects information from CAD files from our file servers and stores them in a database for easy search. InstallationThe download package contains both a pre-compiled binary for Linux RedHat/Fedora (that should work on any x86 Linux) and the source code. It is important to note that this utility relies on the OpenDesign Alliance OpenDWG Toolkit and Viewkit libraries. The pre-compiled package is a static binary, so there is no pre-requisite requirements to use it. CompileDo this only if you need to. Pre-requisites:
I know it's bad, but there is no makefile for this. Once you have the necessary libraries from the OpenDWG kits, untar the provided cad2svg source and copy the following OpenDWG Linux files in your cad2svg directory:
We first need to transform the objcopy -I binary -O elf32-i386 -B i386 adinit.dat adinit.a Then just compile it all together: gcc -Wall -o cad2svg cad2svg.c ad2.a ad3.a adinit.a -lm -lz --static LicenseThis software is free to use and modify but can only be used in non-commercial application and must be redistributed along with its original and modified source code. If you modify it and other could benefit from your change, then send me back your modifications so I can integrate them in the next version. Download
Versions
See alsoComments alfredoSaturday 09 August 2008, at 01:26 GMT+8 [X] thanks for the job. It is a pity that it is no longer free to associate to the OpenDesign Alliance, I would have liked to see the code 'under the hood' mycroesWednesday 10 March 2010, at 21:50 GMT+8 [X] I've been using this converter for a while, right now I'm using our own in-company developed converter that converts DWG to PDF using a more recent version of the OpenDWG Alliance library. Your tool works great, it's unfortunate it doesn't support newer versions of AutoCAD and it's unfortunate that the return code is incorrect when using --version or --help (also --version outputs way more than just a usable version number), but it's good enough for those old DWG files lying around. |