Jump to content

Recommended Posts

Posted

CADTutorians,

 

Does anyone know whether it is possible to open a password protected drawing via Visual LISP, and for positive answer how?

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Ahankhah

    8

  • ReMark

    5

  • MarcoW

    2

  • hanhphuc

    2

Posted

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

Posted

Excellent Mircea:).

Thanks a lot:D.

Posted

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!

Posted
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.

Posted

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.

Posted

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!

Posted
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?

Posted

You want to password protect a drawing then insert it into another drawing? Why? Would good would that be?

Posted
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.

Posted

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)
)

Posted

Lee,

:unsure:I didn't find any difference between dumped info about password protected and password free drawings:?.

Posted
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 ....)

Posted
: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 :(

Posted

You're entirely welcomed. Did you actually test it out?

Posted
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.

  • 7 months later...
Posted

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.

Posted

How does using a password recovery program meant for MS Office help the OP open a password protected drawing created in AutoCAD?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...