Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a thumbnail of a dwg in in a linux environment

Creating a ruby on rails site that uses RMagick to create thumbnails for many types of images. RMagick cannot read dwg files however.

I've tried a few things, looked into the Java library JDWGLib, which would probably allow me to write a converter, but it would be a total from the ground up solution, where I just need a thumbnail.

Also considered using a viewer program to open the file in a remote X session and do a screen capture, however I'm not sure how I could ever guarantee that the viewer had completed opening when I took the screenshot.

I'm not concerned with being able to manipulate the file other than to create the thumbnail. It is going to be used for commercial purposes, so any libraries used need to be compatible.

like image 903
Kyle Avatar asked Mar 23 '10 11:03

Kyle


2 Answers

cad2svg is a simple Linux command-line utility that automatically converts AutoCAD files (both dwg and dxf) to SVG.

the link

like image 193
Felix Avatar answered Sep 28 '22 08:09

Felix


I could not find any command-line-able tool for making thumbnails, on either windows or linux.

I guess you could download the DWGdirect lib (C++) wich allows the exportation of a DWG to a bitmap... but this requires purchasing a membership license on the """Open""" Design Aliance.

I would recommend adding an additional file input on your form that says "thumbnail". And let the users provide the screenshots.

like image 25
kikito Avatar answered Sep 28 '22 09:09

kikito