due to some reasons, dwg files(as well as dxf files) was encrypted when saved onto disk, but once try to open the encrypted dwg file,it will decrypted and ready for the autocad, that means for autocad, the file was raw dwg file that according to autodesk's dwg file specification, so can i dump the binary data of decrypted dwg file by using ObjectARX?
AutoCAD APIs, including ObjectARX, will only allow access to DWG data though controlled APIs, meaning you cannot read raw/binary data using these APIs (unless for specific custom objects hosted on the file).
thanks for your replay. yes, i know that, but still could not get the decrypted data, even i changed the extension of file name.
i thoughr if i could get the stream of the decrypted file?
I understood from your earlier post that AutoCAD can open the file. If AutoCAD can open the file, then it can save it as well.
Your problem description is unclear, but it sounds like you're asking how to read a DWG format file and then somehow convert this into a different (possibly plain text) format file (what you call a 'decrypted file'). Owen's answer was correct that AutoCAD does not expose an API that will give you low level access into the data within a DWG file. But I think the APIs for querying data from a DWG once its opened in AutoCAD or RealDWG are pretty comprehensive.
And you can, of course, save a DWG to DXF format. That is a text file format you can easily open and read using Notepad or similar.
Perhaps if you described why you wanted to access to this low level data, then someone can suggest an approach for which suitable APIs do exist.
thanks, Stephen. My situation is complicate, which i could not describe in a word. it's a problem that once a computer has install a encrypted software that encrypted all dwg and dxf files when saving them. if you use this computer to open the encrypted dwg files, the encrypt software can monitor this event and decrypt the file to the original file(which is according to autodesk's dwg spec.) So to AutoCAD, file is all ok. but when we use a computer that does not install the encrypt software, you can guess what will happen, AutoCAD try to open an encrypted dwg file, which is not according to autodesk's dwg spec.it will definiately fail to open it.
so my idea is like this:
when i open a dwg file successfully on a computer that has install the encrypt software, i know for sure that the data of this opened dwg file in AutoCAD is unencrypted(the raw data, i mentioned before), and at this moment, if i could access the binary data, i can copy the data to somewhere and save them in another format(ie. *.gwd) which would ignore by the encrypt software. then i copy the gwd file to another computer that has not installed the encrypted software, and rename the extension to dwg to open it.
Sorry - I dont think I can help you with that. As Owen said, you can use SaveAs, or you can WBLOCK the DWG contents to another drawing and save that, or you can save as DXF. But if your encryption software is intercepting those saves, then I don't see an easy way around it.
If you have a legitimate reason for needing to bypass the encryption software installed on that computer, then I recommend you contact the vendor of the encryption software for assistance.