PDA

View Full Version : How to save graphics as dxf format



soumya
24th December 2009, 11:26
Hi All,

I have done some graphics on qframe and i need to save it as dxf format how can i do it



Regards,
Soumya

john_god
24th December 2009, 11:53
I think there is a free on-line book in the progecad web site that explain's dxf format. If you cant find it I can email it to you, since it's free. This is the hard aproach. You should also check QCad, google it, I dont remember if it his opensource, but I remember something about some lib's that coulb be helpful for writing dxf files.

robertson1
27th December 2009, 14:10
Hi,

I used dxflib to do this for items in a qgraphicsviews:

http://www.ribbonsoft.com/dxflib.html

I just iterated through all the items and creating corresponding dxf lines
arcs, text etc entities.

john_god
30th December 2009, 23:02
Does it work with GLQWidget (opengl) ???

robertson1
31st December 2009, 20:32
All it does is provide an easyish way to read / write dxf files. You would still have to add all the autocad entities yourself e.g to add a line:


dxf->writeLine(*dw,DL_LineData(p1x, p1y, p2x, p2y, lwidth), DL_Attributes(layer, color, -1, "BYLAYER");

Unfortunately it doesnt provide any magical conversions... But its definetly easier than creating a dxf from scratch.

RealDWG by Autodesk or DirectDWG by the Open Design Alliance are others. Also I think there are some other librarys which directly convert wmf's and SVG files to dxf files. I think Cadsoft make one.