Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hacking AutoCAD files 1

Status
Not open for further replies.

mattninja

Computer
Oct 11, 2001
3
0
0
US
What if I had a .dxf or .dwg file and I wanted to know if it referenced any other AutoCAD files without opening it in AutoCAD? Could I trudge through the data in the file and find out? Could I write a script that would do it?
 
Replies continue below

Recommended for you

With dxf file, this is simple. Save such a file as dxf and open in the text editor to see the identifying lines for XREF etc. Then, write a routine in any language (like VBA from Word or Excel, assuming it should run without opening Autocad and assuming absence of compiler for pure VB or VC) to perform the following:

1. Open the dxf file (text file) for read.
Open WriteFile.txt for write
2. Read line loop to end of file
3. if l SomeText found in line (InStr) write the next line to WriteFile.txt
etc

With DWG file, it is not easy. OpenDWG sitges provide structure of a DWG binary file but I doubt if it is worth the effort.

Hope this is useful.
 
Status
Not open for further replies.
Back
Top