(defun BrowseForFolder ( text Rootfolder / ret y ) (setq y (vlax-get-or-create-object "shell.application")) (if (setq ret (vlax-invoke y "BrowseForFolder" 0 text 1 Rootfolder)) (setq ret (vlax-get (vlax-get ret "Self") "Path"))) (vlax-release-object y) ret ) (defun get_table (table / tb tb_ls) (setq tb (tblnext table t) tb_ls nil ) (while tb (cond ((= (strcase table) "STYLE") (if (= (boole 1 (cdr (assoc 70 tb)) 1) 0);bit 1 bedeutet Symboleintrag, keine Schrift! (setq tb_ls (append tb_ls (list (cdr (assoc 2 tb))))) ) ) ((= (strcase table) "BLOCK") (if (/= (substr (cdr (assoc 2 tb)) 1 1) "*") (setq tb_ls (append tb_ls (list (cdr (assoc 2 tb))))) ) ) (t (setq tb_ls (append tb_ls (list (cdr (assoc 2 tb))))) ) ) (setq tb (tblnext table)) ) (setq tb_ls (vl-sort tb_ls '<)) ) (defun c:all-block-upd ( / bl_liste ant n bl_ex) (setvar "cmdecho" 0) (command "_undo" "_be") (setq bl_liste (get_table "block")) (if bl_pfad (progn (initget "Ja Nein") (setq ant (getkword (strcat "Pfad " bl_pfad " verwenden? /Nein:"))) (if (= ant "Nein") (setq bl-pfad (BrowseForFolder "Blockpfad wählen:" ""))) ) (setq bl_pfad (BrowseForFolder "Blockpfad wählen:" "")) ) (foreach n bl_liste (progn (setq bl_ex (strcat bl_pfad "\\" n ".dwg")) (if (findfile bl_ex) (command "_insert" (strcat n "=" bl_ex) nil)) ) ) (command "_undo" "_end") (setvar "cmdecho" 1) (prin1) ) (defun c:block-upd ( / bl_liste ant n bl_ex) (setvar "cmdecho" 0) (command "_undo" "_be") (setq bl_liste (get_table "block")) (if bl_pfad (progn (initget "Ja Nein") (setq ant (getkword (strcat "Pfad " bl_pfad " verwenden? /Nein:"))) (if (= ant "Nein") (setq bl-pfad (BrowseForFolder "Blockpfad wählen:" ""))) ) (setq bl_pfad (BrowseForFolder "Blockpfad wählen:" "")) ) (foreach n bl_liste (progn (setq bl_ex (strcat bl_pfad "\\" n ".dwg")) (if (findfile bl_ex) (progn (initget "Ja Nein") (setq ant (getkword (strcat "Block " n " aktualisieren? /Nein:"))) (if (/= ant "Nein") (command "_insert" (strcat n "=" bl_ex) nil)) ) ) ) ) (command "_undo" "_end") (setvar "cmdecho" 1) (prin1) ) (prompt "Funktionen ALL-BLOCK-UPD und BLOCK-UPD geladen. (c) H. Jesse 2006")