I came up with this one for when a modified drawing is issued.
;;;
;;; TITLE:issdwg.lsp
;;;
;;; Copyright (C) 2005 by Andy Hudson
;;;
;;; Permission to use, copy, modify, and distribute this
;;; software and its documentation for any purpose and without
;;; fee is hereby granted
;;;
;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR
;;; IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY
;;; PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY
;;; DISCLAIMED.
;;;
;;; Andy Hudson
;;; April 2005
;;;
;;;-------------------------------------------------------------
;;; Description:
;;;
;;; Routine to make Issuing a drawing comply with company Standards
;;; The routine Moves the file to the current folder to ensure only
;;; current drawings remain in the current folder, with a copy
;;; made and bound in the issued folder.
;;;
;;;-------------------------------------------------------------
;;; COMMAND
;;; issdwg
;;;-------------------------------------------------------------
;;;
;;error checker from www.afralisp.com
;;;
(LOAD "x:/aids/blocks/rybka_blocks/lisps/ERROR.LSP")
;;
(DEFUN C:issdwg (/ dirname newdirname filename origfile oldfiledia newfile issname issdir issfile)
;;GET DIRECTORY INFORMATION
(SETQ dirname (GETVAR "DWGPREFIX")
newdirname (VL-STRING-TRIM "\\Mods" dirname)
filename (getvar "dwgname")
origfile (strcat dirname filename))
;;save the drawing
(setq oldfiledia (getvar "filedia"))
(setvar "filedia" 0)
(setq newfile (strcat newdirname "\\" filename))
(if (findfile newfile)
(alert (strcat "File " newfile " already exists In Folder! "))
(progn
(princ (strcat "\nSaving: " Newfile "\n" ))
(command "._saveas" "" newfile)
);progn
);if
(setvar "filedia" oldfiledia)
;;Save to issued folder
;;Create Directory & File Information
(setq issname (vl-string-trim "current" newdirname))
;;create Issued folder
(setq issdir (strcat issname "Issued"))
(vl-mkdir issdir)
;;create issue file
(Setq issdir (vl-string-subst "Issued" "current\\Mods" dirname))
(setq issfile (strcat issdir filename))
;;save the file
(command "._saveas" "" issfile)
(command "-xref" "bind" "*")
(command "-purge" "all" "*" "n")
(command "-purge" "all" "*" "n")
(command "-purge" "all" "*" "n")
(command "-purge" "all" "*" "n")
(command "-purge" "all" "*" "n")
(command "qsave")
;;delete the old file
(vl-file-delete origfile)
(princ)
)
(PROMPT "\n Issue Drawing Lisp loaded, enter issdwg to run.")
(princ)