×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Hacking AutoCAD files

Hacking AutoCAD files

Hacking AutoCAD files

(OP)
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?

RE: Hacking AutoCAD files

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources