试一试
- (vl-load-com)
- (if (and (not *commandReactor*)
- (setq psd1 (getstring "\n输入加密密码:"))
- (setq psd2 (getstring "\n再次输入密码:"))
- (equal psd1 psd2)
- )
- (setq *commandReactor*
- (VLR-Command-Reactor
- nil
- '
- (
- (:vlr-commandWillStart . command-will-start)
- )
- ) ;_ end of vlr-editor-reactor
- )
- )
- (defun command-will-start (reactor command-list)
- (if (and (not passed)
- (not (member (car command-list) '("ZOOM" "PAN")))
- )
- (progn
- (setq psd (getstring "\n输入密码:"))
- (if (equal psd psd1)
- (setq passed T)
- (progn
- (alert "密码不正确!")
- (Vlax-Invoke-Method
- (Vlax-Get-Or-Create-Object "WScript.Shell")
- 'Sendkeys
- "{Esc 2}"
- )
- )
- )
- )
- )
- )
- (defun *error* (msg)
- (if (not passed)
- (Vlax-Invoke-Method
- (Vlax-Get-Or-Create-Object "WScript.Shell")
- 'Sendkeys
- "{Esc 2}"
- )
- )
- (princ)
- )
|