;| Funktion zum Editieren von Attributen "auf dem Bildschirm" ohne den Att-Edit-Dialog Autor: Henning Jesse, VoxelManufaktur Version: 1.1 Datum: 26.06.2009 Status: läuft Anmerkungen: mehrzeilige Attribute führen zu inkonsistenten Daten und werden z.Zt. nicht abgefangen! mit doubble-click-reactor für die Eintragung in der cui unter Doppelklickaktionen |; (defun c:vox-attedit ( / txt_codes att eig vis txt_det t_text n_text) (setvar "cmdecho" 0) (command "_.undo" "_be") (setq txt_codes '(39 10 40 1 50 41 51 7 71 4 72 11 210 8 6 67 62 48 240 420 430)) (or (setq att vox_att_select_by_dbl_mouse_click) (setq att (vl-catch-all-apply 'nentsel (list "\nAttribut wählen:"))) ) (setq vox_att_select_by_dbl_mouse_click nil) (if (and att (not (vl-catch-all-error-p att))) (progn (setq eig (entget (car att))) (if (and (= (cdr (assoc 0 eig)) "ATTRIB");ist Attribut (not (chk-flag (cdr (assoc 70 eig)) 2)); nicht konstant ) (progn (sssetfirst) (if (setq vis (assoc 60 eig)) (setq eig (entmod (subst (cons 60 1) vis eig))) (setq eig (entmod (append eig (list (cons 60 1))))) ) (entupd (car att)) (setq txt_det (vl-remove-if-not (function (lambda (x) (member (car x) txt_codes))) eig)) (if txt_det (entmake (cons '(0 . "TEXT") txt_det))) (setq t_text (entlast)) (command "_ddedit" (list t_text (cadr att)) "") (setq n_text (cdr (assoc 1 (entget t_text)))) (entmod (subst (cons 60 0) (cons 60 1) (subst (cons 1 n_text) (assoc 1 eig) eig))) (entupd (car att)) (entdel t_text) ) (prompt "\nKein editierbares Attribut gewählt!") ) ) (prompt "\nKein Attribut gewählt!") ) (command "_.undo" "_end") (setvar "cmdecho" 1) (prin1) ) (defun chk-flag (wert bit) (= (logand wert bit) bit) ) (or vox_attedit_dbl_mouse_reactor (setq vox_attedit_dbl_mouse_reactor (vlr-mouse-reactor "vox_attedit_dbl_mouse_reactor" '((:vlr-beginDoubleClick . vox-chk-dbl-mouse-click-att)) ) ) ) ;| Das hier ausführen um den reactor wieder zu löschen (if vox_attedit_dbl_mouse_reactor (progn (vlr-remove vox_attedit_dbl_mouse_reactor) (setq vox_attedit_dbl_mouse_reactor nil) ) ) |; (defun vox-chk-dbl-mouse-click-att (reactor werte / att eig) (setq att (vl-catch-all-apply 'nentselp (list (car werte)))) (if (and att (not (vl-catch-all-error-p att))) (progn (setq eig (entget (car att))) (if (and (= (cdr (assoc 0 eig)) "ATTRIB");ist Attribut (not (chk-flag (cdr (assoc 70 eig)) 2)); nicht konstant ) (setq vox_att_select_by_dbl_mouse_click att) (setq vox_att_select_by_dbl_mouse_click nil) ) ) (setq vox_att_select_by_dbl_mouse_click nil) ) ) (defun c:VAE ()(c:vox-attedit)) (prompt "VOX-ATTEDIT (VAE) geladen.") (prin1)