(defun c:lprjmgmt ( / 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"v:/util/lsp/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 6000) (if(member "C:" drivelst) (progn (setq drivestr"C:") (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 Y: \\\\ontsv1\\wordproc%hcf tuesday") ; (command ".sh" "use Y: \\\\ontsv1\\wordproc%francishc") ; ) (setq drivestr"C:") (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! ") ) ) ; (princ "Project Drive L: not available, please connect. ") ) ) ((and(>= clientno 0)(< clientno 6000)) (if(member "C:" drivelst) (progn (setq drivestr"C:") (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! ") ) ) (princ "Project Drive V: not available, please connect. ") ) ) ) (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) )