Stop users saving in c:\ or c drive

Discussion in 'AutoCAD' started by devon, Jun 30, 2004.

  1. devon

    devon Guest

    Hi,

    What would be the simplest way with lisp to prompt a user when they try to save to the c:\ on their local machine?

    I was thinking of a dcl that prompts the user to save to server.

    But I can't figure out a way to jump 'over' the save dialogue once they choose the c: as the destination.

    Thanks
     
    devon, Jun 30, 2004
    #1
  2. You would need to undefine the SAVE command and then write your own save
    command.

    (command "UNDEFINE" "SAVE")
    (defun C:SAVE ()
    ;run dcl without C: as an option
    )

    save to the c:\ on their local machine?
    choose the c: as the destination.
     
    Alan Henderson @ A'cad Solutions, Jun 30, 2004
    #2
  3. devon

    devon Guest

    Hi,

    Thanks for the reply, I was aware that I had to undefine the command. but was looking for some more help with the next step.

    Thanks
     
    devon, Jul 2, 2004
    #3
  4. To create a program that mimics the windows folder environment would be
    quite difficult using DCL.
    One "unelegant" method would be to use DOSLIB dos_getdir function and check
    if C: is selected and then not allow user out of get directory until a drive
    other than C: is selected.

    (defun C:NEWSAVE ()
    (setq DRIVE "C:")
    (while (= DRIVE "C:")
    (setq FOLDER (dos_getdir "Choose Save Folder (C: is NOT allowed)"))
    (setq DRIVE (strcase (substr FOLDER 1 2)))
    )
    (setq FN (strcat FOLDER (getvar "DWGNAME")))
    (if (findfile FN)
    (command "SAVE" FN "Y")
    (command "SAVE" FN)
    )
    (princ)
    )

    Please note that this does NOT prevent the user from closing AutoCAD and
    saving at that time!!
     
    Alan Henderson @ A'cad Solutions, Jul 2, 2004
    #4
  5. devon

    devon Guest

    thanks for the help.

    Much appreciated.

    :)
     
    devon, Jul 5, 2004
    #5
  6. devon

    BTO Guest

    Hi,

    learned from here

    (vlr-dwg-Reactor nil '(:)vlr-saveComplete . saveDrawingInfo )))
    (defun saveDrawingInfo (reactor info )(setq path_dessin (cadr info)) (if (=
    (substr path_dessin 1 1) "C") (alert "message......")))

    copy & past each line to command line and do a save.

    Bruno Toniutti
    (sorry for my english level)
     
    BTO, Jul 6, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.