;;; ;;; ;;; Author: ;;; Henry C. Francis ;;; 425 N. Ashe St. ;;; Southern Pines, NC 28387 ;;; ;;; http://paracadd.com ;;; All rights reserved. ;;; ;;;**************************************************************************** (DEFUN c:next () (SETQ princprfx (IF princprfx (STRCAT princprfx " ") "[DEBUG] " ) ;_ end of IF ) ;_ end of SETQ (IF debug_princs (PROGN (PRINC (STRCAT "\n" princprfx " Beginning NEXT. ")) (PRINC) ) ;_ end of PROGN ) ;_ end of IF (SETQ do_prev nil do_next T ) ;_ end of SETQ (SETQ dwg_incrno 1) ;(uint 1 "" "Number of drawings to advance" (if dwg_incrno dwg_incrno 1))) (c:nextdwg) (IF debug_princs (PROGN (PRINC (STRCAT "\n" princprfx " End NEXT. ")) (PRINC) ) ;_ end of PROGN ) ;_ end of IF (SETQ princprfx (COND ((AND princprfx (WCMATCH princprfx "`[DEBUG`] *")) (SUBSTR princprfx 1 (- (STRLEN princprfx) 2)) ) (T "[DEBUG] ") ) ;_ end of COND ) ;_ end of SETQ (PRINC) ) ;_ end of DEFUN ;;;**************************************************************************** (DEFUN c:prev () (SETQ princprfx (IF princprfx (STRCAT princprfx " ") "[DEBUG] " ) ;_ end of IF ) ;_ end of SETQ (IF debug_princs (PROGN (PRINC (STRCAT "\n" princprfx " Beginning PREV. ")) (PRINC) ) ;_ end of PROGN ) ;_ end of IF (PROGN (SETQ do_prev T do_next nil ) ;_ end of SETQ (SETQ dwg_incrno 1) ;(uint 1 "" "Number of drawings to retreat" nil)) (c:nextdwg) ) (IF debug_princs (PROGN (PRINC (STRCAT "\n" princprfx " End PREV. ")) (PRINC) ) ;_ end of PROGN ) ;_ end of IF (SETQ princprfx (COND ((AND princprfx (WCMATCH princprfx "`[DEBUG`] *")) (SUBSTR princprfx 1 (- (STRLEN princprfx) 2)) ) (T "[DEBUG] ") ) ;_ end of COND ) ;_ end of SETQ (PRINC) ) ;_ end of DEFUN ;;;**************************************************************************** (DEFUN c:xreturn () (SETQ princprfx (IF princprfx (STRCAT princprfx " ") "[DEBUG] " ) ;_ end of IF ) ;_ end of SETQ (IF debug_princs (PROGN (PRINC (STRCAT "\n" princprfx " Beginning PREV. ")) (PRINC) ) ;_ end of PROGN ) ;_ end of IF (IF save_file_chk NIL (LOAD "save_file_chk" "\nFile SAVE_FILE_CHK.LSP not loaded! ")) (IF setprevdwg NIL (LOAD "setprevdwg" "\nFile SETPREVDWG.LSP not loaded! ")) (IF myopen_fun NIL (LOAD "myopen_fun" "\nFile MYOPEN_FUN.LSP not loaded! ")) (IF (AND (getprevdwg) (NOT (WCMATCH (STRCASE bb-prev-dwg)(STRCASE (STRCAT (GETVAR "DWGPREFIX")(GETVAR "DWGNAME"))))) myopen_fun ) (PROGN (save_file_chk) (IF debug_princs (PROGN (PRINC (STRCAT "\n" princprfx " Execute (myopen_fun bb-prev-dwg). ")) (PRINC) ) ;_ end of PROGN ) (myopen_fun bb-prev-dwg) ) (PROGN (SETQ do_prev T do_next nil ) ;_ end of SETQ (SETQ dwg_incrno 1) ;(uint 1 "" "Number of drawings to retreat" nil)) (c:nextdwg) ) ) (IF debug_princs (PROGN (PRINC (STRCAT "\n" princprfx " End PREV. ")) (PRINC) ) ;_ end of PROGN ) ;_ end of IF (SETQ princprfx (COND ((AND princprfx (WCMATCH princprfx "`[DEBUG`] *")) (SUBSTR princprfx 1 (- (STRLEN princprfx) 2)) ) (T "[DEBUG] ") ) ;_ end of COND ) ;_ end of SETQ (PRINC) ) ;_ end of DEFUN ;;;**************************************************************************** (DEFUN c:nextdwg () (IF check_for_doslib nil (LOAD "check_for_doslib" "\nFile CHECK_FOR_DOSLIB.LSP not loaded! ") ) ;_ end of IF (check_for_doslib) (IF setprevdwg NIL (LOAD "setprevdwg" "\nFile SETPREVDWG.LSP not loaded! ")) (IF myopen_fun NIL (LOAD "myopen_fun" "\nFile MYOPEN_FUN.LSP not loaded! ")) (SETQ dwgslist (ACAD_STRLSORT (DOS_DIR (STRCAT (GETVAR "dwgprefix") "*.dwg")) ) ;_ end of ACAD_STRLSORT ) ;_ end of setq (IF do_next (IF (MEMBER (GETVAR "dwgname") dwgslist) (PROGN (SETQ membrlist (MEMBER (GETVAR "dwgname") dwgslist)) (IF (> (LENGTH membrlist) 1) (SETQ newdwgnm (STRCAT (GETVAR "dwgprefix") (CADR membrlist))) (IF (EQ (GETVAR "dwgtitled") 0) (SETQ newdwgnm NIL) (SETQ newdwgnm (STRCAT (GETVAR "dwgprefix") (GETVAR "dwgname"))) ) ) ;_ end of IF ) ;_ end of progn (IF (EQ (GETVAR "dwgtitled") 0) (SETQ newdwgnm NIL) (SETQ newdwgnm (STRCAT (GETVAR "dwgprefix") (GETVAR "dwgname"))) ) ) ;_ end of if (IF (MEMBER (GETVAR "dwgname") dwgslist) (PROGN (SETQ membrlist (MEMBER (GETVAR "dwgname") (REVERSE dwgslist))) (IF (> (LENGTH membrlist) 1) (SETQ newdwgnm (STRCAT (GETVAR "dwgprefix") (CADR membrlist))) (IF (EQ (GETVAR "dwgtitled") 0) (SETQ newdwgnm NIL) (SETQ newdwgnm (STRCAT (GETVAR "dwgprefix") (GETVAR "dwgname"))) ) ) ;_ end of IF ) ;_ end of progn (IF (EQ (GETVAR "dwgtitled") 0) (SETQ newdwgnm NIL) (SETQ newdwgnm (STRCAT (GETVAR "dwgprefix") (GETVAR "dwgname"))) ) ) ;_ end of if ) ;_ end of if (IF (EQ what_to_do 1) ;Save changes? = Cancel (PROGN ;;; (PRINC "\nHELP! ********************************** 0 ") ;;; (PRINC) (SETQ what_to_do NIL) (IF debug_what_to_do NIL (LOAD "MYOPEN_FUN" "\nFile MYOPEN_FUN.LSP not loaded! ")) (debug_what_to_do "Set what_to_do(3) to 1") ) ;_ end of PROGN ;;; (IF ;;; (OR ;;; (AND ;;; client# ;;; project# ;;; sel_proj ;;; rproj ;;; (WCMATCH (STRCASE (GETVAR "DWGPREFIX")) ;;; (STRCASE (STRCAT "*:" client# "\\" project# "\\800*")) ;;; ) ;_ end of WCMATCH ;;; ) ;_ end of AND ;;; (FINDFILE newdwgnm) ;;; ) ;_ end of OR (PROGN (IF initandsdichk nil (LOAD "initandsdichk" "\nFile INITANDSDICHK.LSP not loaded! ") ) ;_ end of IF (SETQ pre_initandsdichk_dbmod (GETVAR "DBMOD")) (initandsdichk) (IF (EQ pre_initandsdichk_dbmod (GETVAR "DBMOD")) nil (IF (EQ pre_initandsdichk_dbmod 0) (COMMAND ".qsave") nil ) ;_ end of IF ) ;_ end of IF (IF save_file_chk nil (LOAD "save_file_chk" "\nFile SAVE_FILE_CHK.LSP not loaded! ") ) ;_ end of IF (save_file_chk) (SETQ skip_save_chk T) (PRINC) ;;; (IF ;;; (AND ;;; client# ;;; project# ;;; sel_proj ;;; rproj ;;; (WCMATCH (STRCASE (GETVAR "DWGPREFIX")) ;;; (STRCASE (STRCAT "*:" client# "\\" project# "\\800*")) ;;; ) ;_ end of WCMATCH ;;; ) ;_ end of AND ;;; (PROGN ;;; (IF debug_next ;;; (PROGN ;;; (PRINC "\nrproj=") ;;; (PRINC rproj) ;;; (PRINC) ;;; ) ;_ end of PROGN ;;; ) ;_ end of IF ;;; (sel_proj rproj) ;;; (SETQ skip_save_chk nil) ;;; ) ;_ end of PROGN (PROGN (IF debug_next (PROGN (PRINC "\nnewdwgnm=") (PRINC newdwgnm) (PRINC) ) ;_ end of PROGN ) ;_ end of IF (IF newdwgnm (PROGN (SETQ foundfile (FINDFILE newdwgnm)) ;;; (IF proj_desc ;;; (set_from_proj_desc) (IF foundfile (PROGN (SETQ this_file (DOS_SPLITPATH foundfile)) (SETQ this_path (SUBSTR (CADR this_file) 2)) (SETQ this_count 1) (WHILE (AND (< this_count (STRLEN this_path)) (NOT (WCMATCH (SUBSTR this_path this_count) "\\*")) ) ;_ end of AND (SETQ this_count (1+ this_count)) ) ;_ end of WHILE (SETQ this_project (SUBSTR this_path 1 (1- this_count))) (WHILE (WCMATCH this_project "* *") (PROGN (SETQ this_cnt 1) (WHILE (NOT (WCMATCH (SUBSTR this_project this_cnt) " *")) (SETQ this_cnt (1+ this_cnt)) ) (SETQ this_project (STRCAT (SUBSTR this_project 1 (1- this_cnt)) "~" (SUBSTR this_project (1+ this_cnt)))) ) ) ) ;_ end of PROGN ) ;_ end of IF (IF sproj_list NIL (PROGN (IF set_proj_list NIL (LOAD "proj" "\nFile PROJ.LSP not loaded! ") ) (IF set_proj_list (set_proj_list)) ) ) (IF sproj_list (PROGN (SETQ project_desc NIL) (FOREACH n sproj_list (IF (WCMATCH n (STRCAT this_project "\t*")) (PROGN (SETQ project_desc n) (set_from_proj_desc) ) ;_ end of PROGN (IF project_desc NIL (PROGN (SETQ project_desc "L:\t\t\t[Unlisted Project]") (IF debug_next (PROGN (PRINC "\n(STRCAT this_project \"\\t*\")=") (PRINC (STRCAT this_project "\t*")) (PRINC "\n") (PRINC n) (PRINC) ) ;_ end of PROGN ) ) ) ) ;_ end of IF ) ;_ end of FOREACH (IF (AND project_desc (NOT (EQ project_desc "L:\t\t\t[Unlisted Project]"))) NIL (SETQ client_name "" client# "" project_name "[Unlisted Project]" ) ;_ end of SETQ ) ) ;_ end of PROGN (PROGN (SETQ client_name "" client# "" project_name "[Unlisted Project]" ) ;_ end of SETQ ) ;_ end of PROGN ) ;_ end of IF ;;; (DOS_DRIVE (CAR this_file)) ;;; (DOS_CHDIR (CADR this_file)) (SETQ opnfil (DOS_GETFILEM (STRCAT "Open " (IF (AND client_name (NOT (EQ client_name ""))) client_name (IF do_next "Next " "Previous ")) (IF (AND project_name (NOT (EQ project_name ""))) (STRCAT (IF (AND client_name (NOT (EQ client_name ""))) " " "") project_name " ") "") "Drawing" ) (IF this_file (STRCAT (NTH 0 this_file)(NTH 1 this_file)) "") (strcat (IF do_next "Next" "Previous") " Drawing (" (nth 2 this_file)(nth 3 this_file) ")|" (nth 2 this_file)(nth 3 this_file) "|Drawing Files (*.dwg)|*.dwg||") ) ;_ end of getfiled opnfil (IF (EQ (TYPE opnfil) 'LIST) (STRCAT (CAR opnfil)(CADR opnfil)) opnfil ) selected-xref opnfil ) ;_ end of SETQ ;;; (IF (AND (>= (FIX (ATOF (GETVAR "acadver"))) 15) ;;; (GETVAR "sdi") ;;; (NOT (EQ (GETVAR "SDI") 0)) ;;; ) ;_ end of AND ;;; (PROGN ;;; (IF myopencmd ;;; NIL ;;; (LOAD "myopencmd" "\nFile MYOPENCMD.LSP not loaded! ") ;;; ) ;_ end of IF ;;; (myopencmd opnfil) ;;; ) (setprevdwg) (IF debug_princs (PROGN (PRINC (STRCAT "\n" princprfx " Execute (myopen_fun opnfil). ")) (PRINC) ) ;_ end of PROGN ) (if (and opnfil (findfile opnfil)) (myopen_fun opnfil) (ALERT "No file was specified to open!") ) ;;; (sopen opnfil) (SETQ skip_save_chk nil) ;;; (PRINC "\nHELP! ********************************** 3 ") ;;; (PRINC) ) (IF c:proj (c:proj) (ALERT "The current drawing is not recognized as a current project drawing.\nOpen a drawing using Project Navigator (Command: PROJ) first.") ) ) ) ;_ end of PROGN ;;; ) ;_ end of IF ) ;_ end of PROGN ;;; (PROGN ;;; ;;; (PRINC "\nHELP! ********************************** 4 ") ;;; ;;; (PRINC) ;;; (IF (LOAD "proj" "\nFile PROJ.LSP not found! ") ;;; (c:proj) ;;; nil ;;; ) ;_ end of if ;;; (SETQ skip_save_chk nil) ;;; ;;; (PRINC "\nHELP! ********************************** 5 ") ;;; ;;; (PRINC) ;;; ) ;_ end of PROGN ;;; ) ;_ end of if ) ;_ end of IF (SETQ dwg_incrno nil) (PRINC) ) ;_ end of defun ;;;**************************************************************************** (DEFUN set_from_proj_desc () (PROGN (SETQ count 1) (WHILE (AND proj_desc (< count (STRLEN proj_desc)) (NOT (WCMATCH (SUBSTR proj_desc count) "\t*")) ) ;_ end of AND (SETQ count (1+ count)) ) ;_ end of WHILE (SETQ count (1+ count)) (WHILE (AND proj_desc (< count (STRLEN proj_desc)) (NOT (WCMATCH (SUBSTR proj_desc count) "\t*")) ) ;_ end of AND (SETQ count (1+ count)) ) ;_ end of WHILE (SETQ client_count count) (SETQ count (1+ count)) (WHILE (AND proj_desc (< count (STRLEN proj_desc)) (NOT (WCMATCH (SUBSTR proj_desc count) "\t*")) ) ;_ end of AND (SETQ count (1+ count)) ) ;_ end of WHILE (IF proj_desc (SETQ client_name (SUBSTR proj_desc (1+ client_count) (1- (- count client_count)))) (SETQ client_name NIL) ) (WHILE (AND proj_desc (< count (STRLEN proj_desc)) (WCMATCH (SUBSTR proj_desc count) "*\t*") ) ;_ end of AND (SETQ count (1+ count)) ) ;_ end of WHILE (IF proj_desc (SETQ project_name (SUBSTR proj_desc count)) (SETQ project_name NIL) ) ) ;_ end of PROGN ) ;_ end of DEFUN ;|«Visual LISP© Format Options» (100 2 40 2 T "end of " 100 9 2 1 0 nil T nil T) ;*** DO NOT add text below the comment! ***|;