pythondwg

How do I open a DWG file extension with Python?


I have a file with extension .dwg (AutoCAD), and I want to call that file from a Python console and present it on the web. Is there a module for the .dwg extension or some other solution?


Solution

  • The best format for displaying these online would (imo) definitely be SVG. Recent browsers support SVG rendering natively; older ones (think IE6) may require an SVG plugin

    So your best bet is probably using a command line convert tool like cad2svg (this is a free linux command line tool) which converts the DWG files to SVG. You can easily do this that from your Python program (using subprocess).