;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 1997-1999 ;;;> EDITED: 07-23-2004 ;;; (defun c:prjmgmt ( / itsr14) (cond ((not (null dos_about))T) ((=(atoi(substr(getvar"acadver")1 2))12)(xload"doslib12")) ((=(atoi(substr(getvar"acadver")1 2))13)(xload"doslib13"nil)) ((=(atoi(substr(getvar"acadver")1 2))14)(arxload"doslib14")(setq itsr14 T)) (T(prompt"DOSLib AutoCAD R12, R13 or R14")) ) (if ustr nil (load"ustr")) (setq clientno(atoi(ustr 1"CDM Client Number"nil nil))) (setq projectnum (ustr 1"CDM Project Number"nil T)) (if(wcmatch projectnum "* *") (setq projectno (substr projectnum 1 (strlen(itoa(read projectnum)))) projectfn (substr projectnum (+(strlen projectno)2)) ) (setq projectno projectnum projectfn nil ) ) (setq drivelst(dos_drives)) (cond ((>= clientno 0) (if(member "L:" drivelst) (progn (setq drivestr"L:") (dos_drive drivestr) (dos_mkdir (strcat drivestr "\\" (itoa clientno))) (dos_mkdir (strcat drivestr "\\" (itoa clientno) "\\" projectno )) (dos_mkdir (strcat drivestr "\\" (itoa clientno) "\\" projectno "\\0CAD")) (setq new_dir (dos_chdir (strcat drivestr "\\" (itoa clientno) "\\" projectno "\\0CAD"))) (if new_dir (princ (strcat "\nDefault Directory set to " new_dir)) (princ "\nDefault Directory was not changed! ") ) ) (progn (if itsr14 (command ".sh" "net use L: \\\\Char_nc\\cadd%francishc") (command ".sh" "use L: \\\\Char_nc\\cadd%francishc") ) (setq drivestr"L:") (dos_drive drivestr) (dos_mkdir (strcat drivestr "\\" (itoa clientno))) (dos_mkdir (strcat drivestr "\\" (itoa clientno) "\\" projectno )) (dos_mkdir (strcat drivestr "\\" (itoa clientno) "\\" projectno "\\0CAD")) (setq new_dir (dos_chdir (strcat drivestr "\\" (itoa clientno) "\\" projectno "\\0CAD"))) (if new_dir (princ (strcat "\nDefault Directory set to " new_dir)) (princ "\nDefault Directory was not changed! ") ) ) ) ) ) (if projectfn (setq opnfil (getfiled "Open Drawing" (strcat new_dir projectfn) "DWG" 4)) (setq opnfil (getfiled "Open Drawing" new_dir "DWG" 4)) ) ; (if (or(wcmatch opnfil "*.dwg")(wcmatch opnfil "*.DWG")) ; nil ; (setq opnfil (strcat opnfil ".DWG")) ; ) (if opnfil (if (eq(getvar"dbmod")0) (command ".open" opnfil) (if (or(eq (getvar"dwgname") "STARTUP")(eq (getvar"dwgname") "DRAWING.DWG")) (command ".open" "y" opnfil) (progn (setq save_it (ukword 1 "Save Quit" "The current drawing has been modified. Save it or Quit?" "Save")) (if (eq save_it "Quit") (command ".open" "y" opnfil) (command ".open" "n" opnfil) ) ) ) ) ) (princ) )