Prompt Message When Closing a Drawing

Prompt Message When Closing a Drawing

Anonymous
Not applicable
6,036 Views
24 Replies
Message 1 of 25

Prompt Message When Closing a Drawing

Anonymous
Not applicable

Is there a way to nix the "close" command and redefine it to include a message?

I'd like to get our guys in the habit of always making sure they are putting revision dates on their drawings. So I'd like have the message "Have you updated Revision Dates for this drawing?" with a YES/NO input from the user come up when they close a drawing. After that, it would bring up the normal save/close screen.

How could I accomplish this?

0 Likes
Accepted solutions (1)
6,037 Views
24 Replies
Replies (24)
Message 21 of 25

john.uhden
Mentor
Mentor
But what if the user types ".CLOSE" or ".CLOSEALL?" Wouldn't a reactor be
better?

John F. Uhden

0 Likes
Message 22 of 25

Sea-Haven
Mentor
Mentor

Hi John, I had 6 staff and I am sure if I said to them do you know about ".close" all 6 would say Huh ? Its people like us that know about this sort of stuff.

0 Likes
Message 23 of 25

john.uhden
Mentor
Mentor
Well, back in the day, decades ago, I used to redefine a lot of commands
and they all learned way too fast to circumvent my wizardry with the
period. Luckily, Peter Petrov invented Vital Lisp and I was able to gain
control again.

John F. Uhden

0 Likes
Message 24 of 25

sagar.adhau
Participant
Participant

Hi Sir,

 

Thanks, if you provide me some thing meanwhile that great help I will try to complete this per your suggestion 

0 Likes
Message 25 of 25

john.uhden
Mentor
Mentor

Here's a redacted example of setting up a close reactor.

(defun @Anonymous_close (Reactor commandInfo / Reaction CmdNames)
  (setq Reaction   (vlr-current-reaction-name)
        CmdNames  (strcase (getvar "cmdnames"))
  )
  (and
    (wcmatch CmdNames "QUIT,EXIT,OPEN,")
    (or
      (> (getvar "dbmod") 0)
      (alert "Drawing has not been modified since last save.")
    )
    ;; do what you want here, e.g.
    (alert "Drawing is beginning to close")
  )
  (vlr-remove-all)
  (princ)
)
(setq dwg_close_reactor
  (vlr-dwg-reactor "My Drawing Close Reactor"
   '(
      (:vlr-BeginClose . @Anonymous_close)
    )
  )
)

John F. Uhden

0 Likes