tags:

views:

39

answers:

2

This is a two part question.

1) Is there any way to get a csv file of all the entity data, including xdata, for an autocad dwg, either using autocad or some other method?

2) Is there an easy way to parse a autocad dxf file to get the entity data into a csv file?

+1  A: 

Unfortunately, neither approach provides an easy method, but it is possible with a little effort.

With a DWG file, the file itself is binary so your best bet would be to write a plugin or script to AutoCAD, using .NET or ObjectArx, but this may be a troublesome approach. AutoLISP would be easier, but I don't think you could output to a file.

Getting the enitity data out of a DXF would be significantly easier, since the DXF is primarily a text format. This would be possible with any programming language, but since there are many possible entities it would take some effort to handle all of the cases. The DXF reference is available at the AutoDESK website. XData is certainly also included in the DXF in a text format, so that shouldn't be a problem.

Knyphe