; @FixDwgDfm added by John F. Uhden (01-18-02) (defun @FixDwgDfm ( / get_dfm dfm fp line fixit new symdata cgsym sym_path) (vl-load-com) (defun get_dfm (|dfm |key / |fp |match |str |pos |path) (if (and (= (type |key) 'STR) (= (type |dfm) 'STR) (setq |match (strcase (strcat |key "=(*"))) ; ) added for textpad (setq |dfm (findfile (strcat |dfm ".DFM"))) (setq |fp (open |dfm "r")) (setq |str "")) (progn (while (and (setq |str (read-line |fp))(not |path)) (and (wcmatch (strcase |str) |match) (setq |str (substr |str (strlen |match))) (setq |pos (vl-string-position (ascii ",") |str)) (setq |path (substr |str 1 |pos)) ) ) (setq |fp (close |fp)) (and |path (not (wcmatch |path "*\\,*/")) (setq |path (strcat |path "\\")) ) |path ) ) ) (if (and (= (getvar "dwgtitled") 1) (setq dfm (strcat (getvar "dwgprefix")(vl-filename-base (getvar "dwgname")) ".dfm")) (setq symdata (get_dfm "sdsk" "symdata")) (setq cgsym (get_dfm "sdsk" "cgsym")) (wcmatch (strcase cgsym 1) "%symdata%*") (setq sym_path (strcase (strcat symdata (substr cgsym 10)) 1)) (setq fp (open dfm "r"))) (progn (while (setq line (read-line fp)) (and (wcmatch (strcase line 1) "sym_path=<*>") (/= (strcase line 1)(strcat "sym_path=<" sym_path ">")) (setq line (strcat "sym_path=<" sym_path ">") fixit 1 ) ) (setq new (cons line new)) ) (setq fp (close fp) new (reverse new) ) (if fixit (if (setq fp (open dfm "w")) (progn (foreach line new (write-line line fp)) (setq fp (close fp)) (prompt (strcat "\nFixed SYM_PATH in " dfm " to \"" sym_path "\"")) (princ (strcat "\nDate: " (rtos (getvar "cdate") 2 6))) ) (prompt (strcat "\nCan't open " dfm " for writing.")) ) (prompt (strcat "\n" dfm " file is okay.")) ) ) ) (princ) ) (@FixDwgDfm) (defun @maxwindow ( / *acad* *doc*) (setq *acad* (vlax-get-acad-object) *doc* (vlax-get *acad* "activedocument") ) (if (< (vlax-get *doc* "windowstate") 3) (vlax-put *doc* "windowstate" 3) ) (princ) ) (cond ((not S::STARTUP) (defun-q S::STARTUP ()(@maxwindow)(@FixDwgDfm)) ) ((listp S::STARTUP) (setq S::STARTUP (append S::STARTUP '((@maxwindow)(@FixDwgDfm)))) ) ((member (type S::STARTUP) '(SUBR USUBR)) (eval (list 'defun-q 's::startup () (list s::startup) ;; NO QUOTE '(@maxwindow) '(@FixDwgDfm) ) ) ) )