Ahankhah Posted June 22, 2011 Posted June 22, 2011 CADTutorians, Does anyone know whether it is possible to open a password protected drawing via Visual LISP, and for positive answer how? Quote
MSasu Posted June 22, 2011 Posted June 22, 2011 This may do the trick: (setq theDocsObj (vla-get-documents (vlax-get-acad-object))) (vla-activate (vla-open theDocsObj MyFileName :vlax-false MyPassword)) Regards, Mircea Quote
MarcoW Posted June 23, 2011 Posted June 23, 2011 Just hopping in, can you give me an example how to protect and unprotect a drawing? I am curious how it works. Thanks in advance! Quote
Ahankhah Posted June 23, 2011 Author Posted June 23, 2011 Just hopping in, can you give me an example how to protect and unprotect a drawing? I am curious how it works.Thanks in advance! 1- Issue SAVEAS command 2- In the Save Drawing As dialog, open Tools menu in the upper right of the window. 3- Select Security Options... item. 4- In the new dialog, under the Password tab, you can set, change, or remove password for the current drawing. Quote
ReMark Posted June 23, 2011 Posted June 23, 2011 All that really does is prevent someone from opening a drawing. It does not prevent a person from editing a drawing once it is opened. Don't forget the password either as there is no means to brute force the drawing open. Quote
MarcoW Posted June 23, 2011 Posted June 23, 2011 Thanks, I did not realize it was that kind of protection, like in word and excel. I have no intentions to use this however. Thanks again for the explaining! Quote
Ahankhah Posted June 23, 2011 Author Posted June 23, 2011 All that really does is prevent someone from opening a drawing. It does not prevent a person from editing a drawing once it is opened. Don't forget the password either as there is no means to brute force the drawing open. Thanks, I did not realize it was that kind of protection, like in word and excel.I have no intentions to use this however. Thanks again for the explaining! Assume that you have a protected dwg file containing some blocks, hatches, linetypes, etc. and you want to use them just by your program. It is a good way to do the task. So you don't need to enclose *.pat or *.lin with your program... :wink: But one thing is remaining. How is it possible to insert a protected .DWG file into another drawing? Quote
ReMark Posted June 23, 2011 Posted June 23, 2011 You want to password protect a drawing then insert it into another drawing? Why? Would good would that be? Quote
Ahankhah Posted June 23, 2011 Author Posted June 23, 2011 You want to password protect a drawing then insert it into another drawing? Why? Would good would that be? I want to use some encrypted info in it. Quote
Lee Mac Posted June 23, 2011 Posted June 23, 2011 Regarding password protection, this object may be of interest :wink:: (defun c:test ( / acsec ) (vl-catch-all-apply (function (lambda nil (setq acsec (vla-getinterfaceobject (vlax-get-acad-object) (strcat "AutoCAD.SecurityParams." (itoa (atoi (getvar 'ACADVER)))) ) ) (vlax-dump-object acsec t) ) ) ) (if acsec (vlax-release-object acsec)) (princ) ) Quote
Ahankhah Posted June 24, 2011 Author Posted June 24, 2011 Lee, :unsure:I didn't find any difference between dumped info about password protected and password free drawings:?. Quote
ketxu Posted June 24, 2011 Posted June 24, 2011 Regarding password protection, this object may be of interest :wink:: (defun c:test ( / acsec ) (vl-catch-all-apply (function (lambda nil (setq acsec (vla-getinterfaceobject (vlax-get-acad-object) (strcat "AutoCAD.SecurityParams." (itoa (atoi (getvar 'ACADVER)))) ) ) (vlax-dump-object acsec t) ) ) ) (if acsec (vlax-release-object acsec)) (princ) ) Oh Lee, i didn't find what difference between before and after lock password.. And can you tell me how to auto set protect password by Lisp (same way goto Option ....) Quote
Lee Mac Posted June 24, 2011 Posted June 24, 2011 :unsure:I didn't find any difference between dumped info about password protected and password free drawings:?. Oh Lee, i didn't find what difference between before and after lock password.. I probably should've fully tested the code before posting - it appears the security parameters can't be retrieved that way Quote
ReMark Posted June 24, 2011 Posted June 24, 2011 Have you seen the DETER.vlx available for free at the dotSOFT website? http://www.dotsoft.com/freestuff.htm Quote
Ahankhah Posted June 24, 2011 Author Posted June 24, 2011 Have you seen the DETER.vlx available for free at the dotSOFT website? http://www.dotsoft.com/freestuff.htm I enthusiastically like it:o. Thank you very much ReMark:D. Quote
ReMark Posted June 24, 2011 Posted June 24, 2011 You're entirely welcomed. Did you actually test it out? Quote
Ahankhah Posted June 24, 2011 Author Posted June 24, 2011 You're entirely welcomed. Did you actually test it out? Yes ReMark, it works nicely. ... But, to be honest, I have written a program to explode unnamed and minserted blocks. I hope I can find it and sent to forum. Quote
kristinbennett1911 Posted February 11, 2012 Posted February 11, 2012 hi It may be caused by entering wrong password. so try to enter right password may your document will open.If you don't know the right password the you install ms office password recovery software.This software gives u to right password of document then you will open your document in easy way. Quote
ReMark Posted February 11, 2012 Posted February 11, 2012 How does using a password recovery program meant for MS Office help the OP open a password protected drawing created in AutoCAD? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.